Close thread pool if present in Geary.Database dtor

Fixes running unit tests on a single CPU host.
This commit is contained in:
Michael Gratton 2019-01-22 00:45:30 +11:00 committed by Michael James Gratton
parent 2c01d032db
commit 92bca47d43

View file

@ -84,9 +84,9 @@ public class Geary.Db.Database : Geary.Db.Context {
}
~Database() {
// Not thrilled about using lock in a dtor
lock (outstanding_async_jobs) {
assert(outstanding_async_jobs == 0);
// Not thrilled about long-running tasks in a dtor
if (this.thread_pool != null) {
GLib.ThreadPool.free((owned) this.thread_pool, true, true);
}
}