Don't clear account errors during account-error-changed emission. I can't

Sat, 16 Feb 2008 14:42:57 +0000

author
Will Thompson <resiak@pidgin.im>
date
Sat, 16 Feb 2008 14:42:57 +0000
changeset 22427
2cd89959da02
parent 22426
bf0638dd1ef6
child 22428
c5365599756d

Don't clear account errors during account-error-changed emission. I can't
reproduce Stu's crash, but this fixes the error minidialog duplication I was
seeing when trying to reproduce it, and I believe the cause is the same.

References #4815

pidgin/gtkblist.c file | annotate | diff | comparison | revisions
--- a/pidgin/gtkblist.c	Thu Feb 14 16:35:14 2008 +0000
+++ b/pidgin/gtkblist.c	Sat Feb 16 14:42:57 2008 +0000
@@ -4408,6 +4408,7 @@
 /***********************************/
 
 #define OBJECT_DATA_KEY_ACCOUNT "account"
+#define DO_NOT_CLEAR_ERROR "do-not-clear-error"
 
 static gboolean
 find_account_widget(GObject *widget,
@@ -4470,6 +4471,11 @@
 {
 	GtkWidget *widget = find_child_widget_by_account(container, account);
 	if(widget) {
+		/* Since we are destroying the widget in response to a change in
+		 * error, we should not clear the error.
+		 */
+		g_object_set_data(G_OBJECT(widget), DO_NOT_CLEAR_ERROR,
+			GINT_TO_POINTER(TRUE));
 		gtk_widget_destroy(widget);
 	}
 }
@@ -4495,7 +4501,12 @@
                          PurpleAccount *account)
 {
 	g_hash_table_remove(gtkblist->connection_errors, account);
-	purple_account_clear_current_error(account);
+	/* If the error dialog is being destroyed in response to the
+	 * account-error-changed signal, we don't want to clear the current
+	 * error.
+	 */
+	if (g_object_get_data(G_OBJECT(dialog), DO_NOT_CLEAR_ERROR) == NULL)
+		purple_account_clear_current_error(account);
 }
 
 #define SSL_FAQ_URI "http://d.pidgin.im/wiki/FAQssl"

mercurial