[tracker/tracker-2.1] tracker-store: Destroy the direct connection on exit



commit fb6a716de203b9d391d2d38808d1d5140cdc7ad8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Sep 22 22:53:24 2018 +0200

    tracker-store: Destroy the direct connection on exit
    
    And let it shut down the internal data manager. Fixes possible crashes
    as the TrackerDirectConnection is not disposed and there may be other
    internal threads trying to access the TrackerDataManager after shutdown.

 src/libtracker-direct/tracker-direct.c | 2 ++
 src/tracker-store/tracker-main.vala    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 326906e44..7a26f2064 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -399,6 +399,8 @@ tracker_direct_connection_finalize (GObject *object)
                        tracker_db_interface_sqlite_wal_checkpoint (wal_iface, TRUE, NULL);
        }
 
+       tracker_data_manager_shutdown (priv->data_manager);
+
        g_clear_object (&priv->store);
        g_clear_object (&priv->journal);
        g_clear_object (&priv->ontology);
diff --git a/src/tracker-store/tracker-main.vala b/src/tracker-store/tracker-main.vala
index 5ad40892b..35eafb212 100644
--- a/src/tracker-store/tracker-main.vala
+++ b/src/tracker-store/tracker-main.vala
@@ -342,8 +342,8 @@ License which can be viewed at:
                Tracker.Writeback.shutdown ();
                Tracker.Events.shutdown ();
 
-               data_manager.shutdown ();
                data_manager = null;
+               connection = null;
                Tracker.DBus.shutdown ();
                Tracker.Log.shutdown ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]