From 7a6412578725e782994a30e429abf9493ac67c7c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 23 Oct 2022 13:52:16 +0200 Subject: examples: Plug leak in example Also, explicitly use tracker_sparql_cursor_close() to make it a better example. --- examples/libtracker-sparql/async-connection.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/libtracker-sparql/async-connection.c b/examples/libtracker-sparql/async-connection.c index 40ae55a34..5fc908ea6 100644 --- a/examples/libtracker-sparql/async-connection.c +++ b/examples/libtracker-sparql/async-connection.c @@ -69,6 +69,7 @@ cursor_cb (GObject *object, g_print ("Async cursor next took: %.6f (for all %d results)\n", g_timer_elapsed (md->timer, NULL), i); + tracker_sparql_cursor_close (cursor); g_object_unref (cursor); g_main_loop_quit (md->loop); } @@ -76,6 +77,8 @@ cursor_cb (GObject *object, g_critical ("Could not run cursor next: %s", error->message); g_error_free (error); + tracker_sparql_cursor_close (cursor); + g_object_unref (cursor); g_main_loop_quit (md->loop); } } -- cgit v1.2.1