[grilo-plugins/tracker-notification: 5/10] tracker: avoid using the same media instance



commit 8d58571df7910f46f8ddb3c7c6d3c822167a08e4
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date:   Mon Feb 14 18:09:24 2011 +0000

    tracker: avoid using the same media instance
    
    Don't notify multiple objects removal with the same media instance.
    
    Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>

 src/tracker/grl-tracker-notif.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker/grl-tracker-notif.c b/src/tracker/grl-tracker-notif.c
index 52f061d..9194eac 100644
--- a/src/tracker/grl-tracker-notif.c
+++ b/src/tracker/grl-tracker-notif.c
@@ -289,7 +289,6 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
     return;
   }
 
-  media = grl_media_new ();
   sources = grl_plugin_registry_get_sources (grl_plugin_registry_get_default (),
 					     FALSE);
 
@@ -305,6 +304,7 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
       break;
     } else {
       /* Notify all sources that a been removed */
+      media = grl_media_new ();
       str_id = g_strdup_printf ("%u", id);
       grl_media_set_id (media, str_id);
       g_free (str_id);
@@ -321,6 +321,7 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
 	}
 	source = source->next;
       }
+      g_object_unref (media);
     }
     subject = subject->next;
   }
@@ -334,6 +335,7 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
 	g_string_append_printf (request_str, ", %u", id);
       } else {
 	/* Notify all sources that a been removed */
+        media = grl_media_new ();
 	str_id = g_strdup_printf ("%u", id);
 	grl_media_set_id (media, str_id);
 	g_free (str_id);
@@ -350,6 +352,7 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
 	  }
 	  source = source->next;
 	}
+        g_object_unref (media);
       }
       subject = subject->next;
     }
@@ -368,7 +371,6 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
     tracker_evt_postupdate_sources (evt);
   }
 
-  g_object_unref (media);
   g_string_free (request_str, TRUE);
 }
 



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