[tracker/wip/carlosg/tracker-3.0-api-breaks] libtracker-data: Join WAL thread before freeing abs name on finalize
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/tracker-3.0-api-breaks] libtracker-data: Join WAL thread before freeing abs name on finalize
- Date: Wed, 12 Feb 2020 11:46:38 +0000 (UTC)
commit 0bea5ed3c5e6218598f386cda64a5dfc193b0567
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Feb 12 12:31:05 2020 +0100
libtracker-data: Join WAL thread before freeing abs name on finalize
The WAL thread may be running while we are finalizing the DB manager, if it
happens to be the first time it ever does, it will create the dedicated DB
interface, except that the DB manager did already free the abs_name field
with the full DB path.
This results in the DB interface maybe opening a new sqlite DB with a
garbage filename that is left behind. This happens to be somehow seen by
running the ontology-changes functional test as of recently.
src/libtracker-data/tracker-db-manager.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 33e32c216..3d2cb94fb 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -917,12 +917,12 @@ tracker_db_manager_finalize (GObject *object)
TrackerDBManager *db_manager = TRACKER_DB_MANAGER (object);
gboolean readonly = (db_manager->flags & TRACKER_DB_MANAGER_READONLY) != 0;
- g_async_queue_unref (db_manager->interfaces);
- g_free (db_manager->db.abs_filename);
-
if (db_manager->wal_thread)
g_thread_join (db_manager->wal_thread);
+ g_async_queue_unref (db_manager->interfaces);
+ g_free (db_manager->db.abs_filename);
+
g_clear_object (&db_manager->db.wal_iface);
if (db_manager->db.iface) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]