[PATCH 1/4] tracker: fix memory leak on removed sources



From: Lionel Landwerlin <lionel g landwerlin linux intel com>

We are increasing refcount of tracker sources in the notification
process (tracker_dbus_signal_cb function), we need to decrease it when
we're done.

Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>
---
 src/media/tracker/grl-tracker-media-notif.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/media/tracker/grl-tracker-media-notif.c b/src/media/tracker/grl-tracker-media-notif.c
index fb52c44..206fb58 100644
--- a/src/media/tracker/grl-tracker-media-notif.c
+++ b/src/media/tracker/grl-tracker-media-notif.c
@@ -71,9 +71,9 @@ tracker_evt_update_new (void)
 {
   tracker_evt_update_t *evt = g_slice_new0 (tracker_evt_update_t);
 
-  evt->inserted_items = g_hash_table_new (g_direct_hash, g_direct_equal);
-  evt->deleted_items = g_hash_table_new (g_direct_hash, g_direct_equal);
-  evt->updated_items = g_hash_table_new (g_direct_hash, g_direct_equal);
+  evt->inserted_items = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
+  evt->deleted_items = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
+  evt->updated_items = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
 
   evt->orphan_items = g_hash_table_new (g_direct_hash, g_direct_equal);
 
-- 
1.7.4.1



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