[tracker-miners/wip/carlosg/timeouts-and-stuff: 1/3] miners: Explicitly close the connection on shutdown



commit 4853fccc7fc3e0a43d0968597b8c4522c4f51929
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jul 1 09:55:19 2020 +0200

    miners: Explicitly close the connection on shutdown
    
    In miner-fs the final connection unref was missing, however don't
    rely on refcount being perfectly accounted and explicitly close the
    connection, so a clean exit is ensured.

 src/miners/fs/tracker-main.c       | 3 +++
 src/miners/rss/tracker-main.c      | 1 +
 src/tracker-extract/tracker-main.c | 2 ++
 3 files changed, 6 insertions(+)
---
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index c9ef8ee0b..a0722320a 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -999,6 +999,9 @@ main (gint argc, gchar *argv[])
        g_object_unref (connection);
        tracker_domain_ontology_unref (domain_ontology);
 
+       tracker_sparql_connection_close (sparql_conn);
+       g_object_unref (sparql_conn);
+
        g_print ("\nOK\n\n");
 
        return EXIT_SUCCESS;
diff --git a/src/miners/rss/tracker-main.c b/src/miners/rss/tracker-main.c
index 70e654c42..9059240b0 100644
--- a/src/miners/rss/tracker-main.c
+++ b/src/miners/rss/tracker-main.c
@@ -288,6 +288,7 @@ main (int argc, char **argv)
        g_main_loop_run (loop);
 
        g_main_loop_unref (loop);
+       tracker_sparql_connection_close (sparql_conn);
        g_object_unref (sparql_conn);
        g_object_unref (endpoint);
        g_object_unref (miner);
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 04c059b53..c0ed1ec23 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -462,6 +462,8 @@ main (int argc, char *argv[])
        g_object_unref (proxy);
        g_object_unref (connection);
        tracker_domain_ontology_unref (domain_ontology);
+       tracker_sparql_connection_close (sparql_connection);
+       g_object_unref (sparql_connection);
 
        g_object_unref (config);
 


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