[tracker/sam/libtracker-control-fix-critical] libtracker-control: Avoid g_critical() when unable to connect to bus



commit ab2a5488fb46d5f0b77bd18e3d2956d55e2d5073
Author: Sam Thursfield <sam afuera me uk>
Date:   Wed Jul 10 16:44:19 2019 +0100

    libtracker-control: Avoid g_critical() when unable to connect to bus
    
    I was getting this error when running inside a container that had no
    D-Bus session bus:
    
        # /opt/tracker/bin/tracker daemon status
    
        (tracker daemon:194): GLib-GObject-CRITICAL **: 15:41:34.247: g_object_unref: assertion 'G_IS_OBJECT 
(object)' failed
        Could not get status, manager could not be created, Cannot autolaunch D-Bus without X11 $DISPLAY
    
    This change prevents the g_critical() warning from appearing.

 src/libtracker-control/tracker-miner-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-control/tracker-miner-manager.c b/src/libtracker-control/tracker-miner-manager.c
index 52aa16617..06fb665fa 100644
--- a/src/libtracker-control/tracker-miner-manager.c
+++ b/src/libtracker-control/tracker-miner-manager.c
@@ -574,7 +574,7 @@ miner_manager_finalize (GObject *object)
        g_list_free (priv->miners);
        g_hash_table_unref (priv->miner_proxies);
        g_free (priv->domain_ontology_name);
-       g_object_unref (priv->domain_ontology);
+       g_clear_object (&priv->domain_ontology);
 
        G_OBJECT_CLASS (tracker_miner_manager_parent_class)->finalize (object);
 }


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