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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Apr 23 17:21:09 EEST 2007
Author: moimart
Date: 2007-04-23 17:21:07 +0300 (Mon, 23 Apr 2007)
New Revision: 11201

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-window.c
Log:
	
        * libhildondesktop/hildon-desktop-popup-window.c:
        - Added forgotten _finalize




Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-23 14:14:32 UTC (rev 11200)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-04-23 14:21:07 UTC (rev 11201)
@@ -1,5 +1,10 @@
 2007-04-23  Moises Martinez  <moises.martinez at nokia.com>
 
+	* libhildondesktop/hildon-desktop-popup-window.c:
+	- Added forgotten _finalize
+
+2007-04-23  Moises Martinez  <moises.martinez at nokia.com>
+
 	* libhildondesktop/hildon-desktop-popup-window.[ch]:
 	- Added new methods to access panes.
 	- Fixed behavior.

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-window.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-window.c	2007-04-23 14:14:32 UTC (rev 11200)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-window.c	2007-04-23 14:21:07 UTC (rev 11201)
@@ -60,6 +60,7 @@
                                                       const GValue *value, 
                                                       GParamSpec *pspec);
 
+static void hildon_desktop_popup_finalize (GObject *object);
 static void hildon_desktop_popup_window_realize (GtkWidget *widget);
 static void hildon_desktop_popup_window_unrealize (GtkWidget *widget);
 static void hildon_desktop_popup_window_show (GtkWidget *widget);
@@ -126,6 +127,7 @@
   object_class->constructor  = hildon_desktop_popup_window_constructor;
   object_class->set_property = hildon_desktop_popup_window_set_property;
   object_class->get_property = hildon_desktop_popup_window_get_property;
+  object_class->finalize     = hildon_desktop_popup_finalize;
 
   widget_class->motion_notify_event     = hildon_desktop_popup_window_motion_notify;
   widget_class->leave_notify_event      = hildon_desktop_popup_window_leave_notify;
@@ -207,6 +209,9 @@
   {	  
     popup->priv->extra_panes[i] = gtk_window_new (GTK_WINDOW_POPUP);
 
+    g_object_ref (G_OBJECT (popup->priv->extra_panes[i]));
+    gtk_object_sink (GTK_OBJECT (popup->priv->extra_panes[i]));		 
+
     gtk_window_set_type_hint (GTK_WINDOW (popup->priv->extra_panes[i]),
 		    	      GDK_WINDOW_TYPE_HINT_MENU);
 
@@ -228,6 +233,19 @@
   return object;
 }
 
+static void 
+hildon_desktop_popup_finalize (GObject *object)
+{
+  HildonDesktopPopupWindow *popup = HILDON_DESKTOP_POPUP_WINDOW (object);
+  register gint i;
+  
+  if (popup->priv->extra_panes)
+   for (i=0; i < popup->priv->n_extra_panes; i++)
+     g_object_unref (popup->priv->extra_panes[i]);
+
+  G_OBJECT_CLASS (hildon_desktop_popup_window_parent_class)->finalize (object);
+}	
+
 /* At some point I will use macros :) */
 
 static void 


More information about the maemo-commits mailing list