[tracker/wip/carlosg/tracker-3.0-api-breaks: 79/79] libtracker-direct: Unref data manager after we free all notifiers



commit 33e764d35567fb363b844b5b63f85722ca2b480e
Author: Sam Thursfield <sam afuera me uk>
Date:   Wed Jan 22 01:18:50 2020 +0100

    libtracker-direct: Unref data manager after we free all notifiers
    
    The detach_notifier() function accesses the priv->data_manager object.
    We can't free priv->data_manager in tracker_direct_connetion_dispose()
    because we later call detach_notifier().
    
    There doesn't seem to be a ref cycle being broken here, so I moved the
    priv->data_manager free later on.

 src/libtracker-direct/tracker-direct.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 9270f74e8..61ca72fe2 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -525,11 +525,6 @@ tracker_direct_connection_dispose (GObject *object)
                priv->select_pool = NULL;
        }
 
-       if (priv->data_manager) {
-               tracker_data_manager_shutdown (priv->data_manager);
-               g_clear_object (&priv->data_manager);
-       }
-
        G_OBJECT_CLASS (tracker_direct_connection_parent_class)->dispose (object);
 }
 
@@ -551,6 +546,11 @@ tracker_direct_connection_finalize (GObject *object)
                detach_notifier (conn, notifier);
        }
 
+       if (priv->data_manager) {
+               tracker_data_manager_shutdown (priv->data_manager);
+               g_clear_object (&priv->data_manager);
+       }
+
        g_clear_object (&priv->store);
        g_clear_object (&priv->ontology);
        g_clear_object (&priv->namespace_manager);


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