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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Apr 30 12:24:17 EEST 2007
Author: lucasr
Date: 2007-04-30 12:24:16 +0300 (Mon, 30 Apr 2007)
New Revision: 11376

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c
Log:
2007-04-27  Lucas Rocha  <lucas.rocha at nokia.com>

	* libhildondesktop/hildon-desktop-notification-manager.c: fix crash
	when notification is activated before timeout.


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-30 08:32:32 UTC (rev 11375)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-30 09:24:16 UTC (rev 11376)
@@ -1,3 +1,8 @@
+2007-04-27  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* libhildondesktop/hildon-desktop-notification-manager.c: fix crash
+	when notification is activated before timeout.
+
 2007-04-27  Johan Bilien  <johan.bilien at nokia.com>
 
 	* configure.ac:

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c	2007-04-30 08:32:32 UTC (rev 11375)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c	2007-04-30 09:24:16 UTC (rev 11376)
@@ -210,19 +210,25 @@
 }
 
 static gboolean 
-hildon_desktop_notification_manager_timeout (GtkTreeIter *iter)
+hildon_desktop_notification_manager_timeout (gint id)
 {
   GtkListStore *nm = 
-     hildon_desktop_notification_manager_get_singleton ();	
+     hildon_desktop_notification_manager_get_singleton ();
+  GtkTreeIter iter;
 
+  if (!hildon_desktop_notification_manager_find_by_id (HILDON_DESKTOP_NOTIFICATION_MANAGER (nm), 
+			  			       id, 
+						       &iter))
+  {
+    return FALSE;
+  }
+
   /* Notify the client */
   hildon_desktop_notification_manager_notification_closed (HILDON_DESKTOP_NOTIFICATION_MANAGER (nm), 
-		  					   iter);
+		  					   &iter);
  
-  gtk_list_store_remove (nm, iter);
+  gtk_list_store_remove (nm, &iter);
 
-  g_free (iter);
-
   return FALSE;
 }
 
@@ -268,7 +274,7 @@
                                             gint                   timeout, 
                                             DBusGMethodInvocation *context)
 {
-  GtkTreeIter iter,*iter_timeout;
+  GtkTreeIter iter;
   GError *error = NULL;
   GdkPixbuf *pixbuf = NULL;
   GtkIconTheme *icon_theme;
@@ -368,13 +374,9 @@
 
   if (timeout > 0)
   {
-    iter_timeout = g_new0 (GtkTreeIter, 1);
-
-    *iter_timeout = iter;  
-    
     g_timeout_add (timeout,
 		   (GSourceFunc) hildon_desktop_notification_manager_timeout,
-		   iter_timeout);
+		   GINT_TO_POINTER (id));
   }
 		      
   dbus_g_method_return (context, id);
@@ -525,10 +527,6 @@
   gchar **message_elements;
   gint n_elements;
 
-  g_debug ("######################################### DBUS CALLBACK ##########################################");
-  g_debug (desc);
-  g_debug ("######################################### DBUS CALLBACK ##########################################");
-  
   message_elements = g_strsplit (desc, " ", 5);
 
   n_elements = g_strv_length (message_elements);


More information about the maemo-commits mailing list