[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 95/116] tests/libtracker-miner: Fix memory leaks



commit eddfce7383bd9ce7e0d464c9b3dcfb39a6fbed7d
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Wed Jan 23 19:33:49 2019 +0000

    tests/libtracker-miner: Fix memory leaks

 tests/libtracker-miner/tracker-priority-queue-test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/tests/libtracker-miner/tracker-priority-queue-test.c 
b/tests/libtracker-miner/tracker-priority-queue-test.c
index a32d0fb81..893ca14f9 100644
--- a/tests/libtracker-miner/tracker-priority-queue-test.c
+++ b/tests/libtracker-miner/tracker-priority-queue-test.c
@@ -130,6 +130,11 @@ test_priority_queue_find (void)
         g_assert_cmpstr (result, !=, NULL);
         g_assert_cmpint (priority, ==, 10);
 
+        while (!tracker_priority_queue_is_empty (queue)) {
+            gchar *text = (gchar *) tracker_priority_queue_pop (queue, NULL);
+            g_free (text);
+        }
+
         tracker_priority_queue_unref (queue);
 }
 
@@ -157,6 +162,11 @@ test_priority_queue_foreach (void)
 
         g_assert_cmpint (counter, ==, 3);
 
+        while (!tracker_priority_queue_is_empty (queue)) {
+            gchar *text = (gchar *) tracker_priority_queue_pop (queue, NULL);
+            g_free (text);
+        }
+
         tracker_priority_queue_unref (queue);
 }
 


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