changeset 21406:7e07f5b271e5

Use an idle callback to destroy PidginMiniDialogs when a button is pressed. Calling gtk_widget_destroy() directly from the button-clicked callback was eating the stack.
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 04 Nov 2007 23:57:43 +0000
parents 7ea1f93cffe2
children dc5012153bfa
files pidgin/minidialog.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/minidialog.c	Sun Nov 04 23:56:25 2007 +0000
+++ b/pidgin/minidialog.c	Sun Nov 04 23:57:43 2007 +0000
@@ -99,6 +99,13 @@
 	gpointer user_data;
 };
 
+static gboolean
+idle_destroy_cb(GtkWidget *mini_dialog)
+{
+	gtk_widget_destroy(mini_dialog);
+	return FALSE;
+}
+
 static void
 mini_dialog_button_clicked_cb(GtkButton *button,
                               gpointer user_data)
@@ -107,7 +114,7 @@
 
 	data->callback(data->mini_dialog, button, data->user_data);
 
-	gtk_widget_destroy(GTK_WIDGET(data->mini_dialog));
+	g_idle_add((GSourceFunc) idle_destroy_cb, data->mini_dialog);
 }
 
 static void