libpurple/connection.c

branch
soc.2013.gobjectification.plugins
changeset 36972
dfe5c47d56a9
parent 36963
6cc39a95f75b
parent 35130
2033f0755d68
child 37066
1ebce1f4993b
--- a/libpurple/connection.c	Thu Jan 02 21:37:02 2014 +0530
+++ b/libpurple/connection.c	Sat Jan 04 23:00:37 2014 +0530
@@ -81,6 +81,8 @@
 	 */
 	gboolean wants_to_die;
 
+	gboolean is_finalizing;    /**< The object is being destroyed. */
+
 	/** The connection error and its description if an error occured */
 	PurpleConnectionErrorInfo *error_info;
 
@@ -252,7 +254,8 @@
 			ops->disconnected(gc);
 	}
 
-	g_object_notify_by_pspec(G_OBJECT(gc), properties[PROP_STATE]);
+	if (!priv->is_finalizing)
+		g_object_notify_by_pspec(G_OBJECT(gc), properties[PROP_STATE]);
 }
 
 void
@@ -730,6 +733,8 @@
 	GSList *buddies;
 	gboolean remove = FALSE;
 
+	priv->is_finalizing = TRUE;
+
 	account = purple_connection_get_account(gc);
 
 	purple_debug_info("connection", "Disconnecting connection %p\n", gc);

mercurial