Fix criticals on disconnect happening after closing Account editor

Sun, 30 Oct 2022 03:31:24 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Sun, 30 Oct 2022 03:31:24 -0500
changeset 41865
41e66d907bc9
parent 41864
6f490dec468f
child 41866
dadd84e44a30

Fix criticals on disconnect happening after closing Account editor

The connection callback for updating the Account Editor was not disconnected when the dialog was closed, meaning it would cause criticals on disconnect.

Testing Done:
Opened Account editor, closed it, disconnected the account, and saw no criticals from the editor code.

Reviewed at https://reviews.imfreedom.org/r/2001/

pidgin/pidginaccounteditor.c file | annotate | diff | comparison | revisions
--- a/pidgin/pidginaccounteditor.c	Sun Oct 30 03:29:33 2022 -0500
+++ b/pidgin/pidginaccounteditor.c	Sun Oct 30 03:31:24 2022 -0500
@@ -708,9 +708,9 @@
 {
 	if(g_set_object(&editor->account, account)) {
 		if(PURPLE_IS_ACCOUNT(account)) {
-			g_signal_connect(account, "notify::connection",
-			                 G_CALLBACK(pidgin_account_editor_connection_changed_cb),
-			                 editor);
+			g_signal_connect_object(account, "notify::connection",
+			                        G_CALLBACK(pidgin_account_editor_connection_changed_cb),
+			                        editor, 0);
 		}
 
 		g_object_notify_by_pspec(G_OBJECT(editor), properties[PROP_ACCOUNT]);

mercurial