changeset 23381:bd542a092a3b

Small leak fix.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 21 Jun 2008 04:50:36 +0000
parents 3f765f7e79d4
children 8ea901db8e34
files pidgin/gtkmenutray.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmenutray.c	Wed Jun 18 03:27:05 2008 +0000
+++ b/pidgin/gtkmenutray.c	Sat Jun 21 04:50:36 2008 +0000
@@ -84,19 +84,23 @@
 }
 
 static void
-pidgin_menu_tray_finalize(GObject *obj) {
+pidgin_menu_tray_finalize(GObject *obj)
+{
+	PidginMenuTray *tray = PIDGIN_MENU_TRAY(obj);
 #if 0
 	/* This _might_ be leaking, but I have a sneaking suspicion that the widget is
 	 * getting destroyed in GtkContainer's finalize function.  But if were are
 	 * leaking here, be sure to figure out why this causes a crash.
 	 *	-- Gary
 	 */
-	PidginMenuTray *tray = PIDGIN_MENU_TRAY(obj);
 
 	if(GTK_IS_WIDGET(tray->tray))
 		gtk_widget_destroy(GTK_WIDGET(tray->tray));
 #endif
 
+	if (tray->tooltips)
+		g_object_ref_sink(G_OBJECT(tray->tooltips));
+
 	G_OBJECT_CLASS(parent_class)->finalize(obj);
 }