pidgin: 876a824b: Plug a little leak. We should not use 'd...

sadrul at pidgin.im sadrul at pidgin.im
Sat Jun 7 16:20:47 EDT 2008


-----------------------------------------------------------------
Revision: 876a824bb4677ca7738acdf553d255fd1a4c857b
Ancestor: bd9708fed922d9c7c3c4e54e4f20713b6844778d
Author: sadrul at pidgin.im
Date: 2008-06-07T19:11:48
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/876a824bb4677ca7738acdf553d255fd1a4c857b

Modified files:
        pidgin/gtksavedstatuses.c

ChangeLog: 

Plug a little leak. We should not use 'delete_event' signal, because it
doesn't get emitted when the dialog gets destroyed from a
gtk_widget_destroy call. We should use the 'destroy' signal instead.

-------------- next part --------------
============================================================
--- pidgin/gtksavedstatuses.c	b1bbaaacd22b5981a17ac5c0ea475eb91a905d4f
+++ pidgin/gtksavedstatuses.c	5c938b426a9e3b5935ee66c71aba844d2529b519
@@ -717,8 +717,8 @@ status_editor_remove_dialog(StatusEditor
 }
 
 
-static gboolean
-status_editor_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+static void
+status_editor_destroy_cb(GtkWidget *widget, gpointer user_data)
 {
 	StatusEditor *dialog = user_data;
 
@@ -726,19 +726,13 @@ status_editor_destroy_cb(GtkWidget *widg
 	g_free(dialog->original_title);
 	g_object_unref(G_OBJECT(dialog->model));
 	g_free(dialog);
-
-	return FALSE;
 }
 
 static void
 status_editor_cancel_cb(GtkButton *button, gpointer user_data)
 {
 	StatusEditor *dialog = user_data;
-
-	status_editor_remove_dialog(dialog);
 	gtk_widget_destroy(dialog->window);
-	g_free(dialog->original_title);
-	g_free(dialog);
 }
 
 static void
@@ -842,20 +836,11 @@ status_editor_ok_cb(GtkButton *button, g
 	g_free(message);
 	g_free(unformatted);
 
-	status_editor_remove_dialog(dialog);
-	gtk_widget_destroy(dialog->window);
-	g_free(dialog->original_title);
-
-/*
-	if (status_window != NULL)
-	  add_status_to_saved_status_list(status_window->model, saved_status);
-*/
-
 	/* If they clicked on "Save & Use" or "Use," then activate the status */
 	if (button != dialog->save_button)
 		purple_savedstatus_activate(saved_status);
 
-	g_free(dialog);
+	gtk_widget_destroy(dialog->window);
 }
 
 static void
@@ -1133,7 +1118,7 @@ pidgin_status_editor_show(gboolean edit,
 
 	dialog->window = win = pidgin_create_dialog(_("Status"), PIDGIN_HIG_BORDER, "status", TRUE);
 
-	g_signal_connect(G_OBJECT(win), "delete_event",
+	g_signal_connect(G_OBJECT(win), "destroy",
 					 G_CALLBACK(status_editor_destroy_cb), dialog);
 
 	/* Setup the vbox */
@@ -1325,25 +1310,20 @@ substatus_editor_remove_dialog(SubStatus
 	}
 }
 
-static gboolean
-substatus_editor_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+static void
+substatus_editor_destroy_cb(GtkWidget *widget, gpointer user_data)
 {
 	SubStatusEditor *dialog = user_data;
 
 	substatus_editor_remove_dialog(dialog);
 	g_free(dialog);
-
-	return FALSE;
 }
 
 static void
 substatus_editor_cancel_cb(GtkButton *button, gpointer user_data)
 {
 	SubStatusEditor *dialog = user_data;
-
-	substatus_editor_remove_dialog(dialog);
 	gtk_widget_destroy(dialog->window);
-	g_free(dialog);
 }
 
 
@@ -1361,7 +1341,6 @@ substatus_editor_ok_cb(GtkButton *button
 	if (!gtk_combo_box_get_active_iter(dialog->box, &iter))
 	{
 		gtk_widget_destroy(dialog->window);
-		g_free(dialog);
 		return;
 	}
 
@@ -1389,7 +1368,6 @@ substatus_editor_ok_cb(GtkButton *button
 	gtk_widget_destroy(dialog->window);
 	g_free(id);
 	g_free(message);
-	g_free(dialog);
 }
 
 static void
@@ -1438,7 +1416,7 @@ edit_substatus(StatusEditor *status_edit
 	dialog->window = win = pidgin_create_dialog(tmp, PIDGIN_HIG_BORDER, "substatus", TRUE);
 	g_free(tmp);
 
-	g_signal_connect(G_OBJECT(win), "delete_event",
+	g_signal_connect(G_OBJECT(win), "destroy",
 					 G_CALLBACK(substatus_editor_destroy_cb), dialog);
 
 	/* Setup the vbox */


More information about the Commits mailing list