diff --git a/src/engine/db/db-database.vala b/src/engine/db/db-database.vala index 90f8f5c2..a13a8777 100644 --- a/src/engine/db/db-database.vala +++ b/src/engine/db/db-database.vala @@ -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); } }