[maemo-commits] [maemo-commits] r14133 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Sep 27 10:31:15 EEST 2007
Author: jobi
Date: 2007-09-27 10:31:13 +0300 (Thu, 27 Sep 2007)
New Revision: 14133

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c
Log:

2007-09-27 Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/hildon-desktop-notification-manager.c: unref
	the notification icon after storing it in the ListStore, to avoid
	leaking it



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-27 06:51:22 UTC (rev 14132)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-27 07:31:13 UTC (rev 14133)
@@ -1,5 +1,11 @@
 2007-09-27 Johan Bilien  <johan.bilien at nokia.com>
 
+	* libhildondesktop/hildon-desktop-notification-manager.c: unref
+	the notification icon after storing it in the ListStore, to avoid
+	leaking it
+
+2007-09-27 Johan Bilien  <johan.bilien at nokia.com>
+
 	* libhildondesktop/hildon-desktop-panel.c (hildon_desktop_panel_cadd):
 	added protection against NULL widget. Fixes: NB#70668
 

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c	2007-09-27 06:51:22 UTC (rev 14132)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c	2007-09-27 07:31:13 UTC (rev 14133)
@@ -233,6 +233,7 @@
 
       if (error)
       {
+	pixbuf = NULL; /* It'd be already NULL */
 	g_warning ("Notification icon not loaded: %s", error->message);
         g_error_free (error);
       }
@@ -337,6 +338,7 @@
 {
   HildonDesktopNotificationManager *nm;
   GtkTreeIter iter;
+  GdkPixbuf *icon;
   GHashTable *hints;
   GValue *hint;
   GArray *actions;
@@ -391,12 +393,14 @@
 
   gtk_list_store_append (GTK_LIST_STORE (nm), &iter);
 
+  icon = hildon_desktop_notification_manager_get_icon (argv[2]);
+
   gtk_list_store_set (GTK_LIST_STORE (nm),
 		      &iter,
 		      HD_NM_COL_APPNAME, argv[1],
 		      HD_NM_COL_ID, id,
 		      HD_NM_COL_ICON_NAME, argv[2],
-		      HD_NM_COL_ICON, hildon_desktop_notification_manager_get_icon (argv[2]),
+		      HD_NM_COL_ICON, icon,
 		      HD_NM_COL_SUMMARY, argv[3],
 		      HD_NM_COL_BODY, argv[4],
 		      HD_NM_COL_ACTIONS, g_array_free (actions, FALSE),
@@ -407,6 +411,9 @@
 		      HD_NM_COL_SENDER, argv[6],
 		      -1);
 
+  if (icon)
+    g_object_unref (icon);
+
   return 0;
 }
 
@@ -1208,6 +1215,8 @@
   }
 
   g_free (sender);
+  g_object_unref (pixbuf);
+
   
   dbus_g_method_return (context, id);
 


More information about the maemo-commits mailing list