/pidgin/main: 2033f0755d68: Fix a glib warning, by not calling g...

Tomasz Wasilczyk twasilczyk at pidgin.im
Thu Jan 2 19:37:00 EST 2014


Changeset: 2033f0755d685d03ecc7c158bac52202f2181fc8
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-01-03 01:36 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/2033f0755d68

Description:

Fix a glib warning, by not calling g_object_notify while the connection object is being destroyed. There may be a better fix possible, though

diffstat:

 libpurple/connection.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (31 lines):

diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -81,6 +81,8 @@ struct _PurpleConnectionPrivate
 	 */
 	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;
 
@@ -257,7 +259,8 @@ purple_connection_set_state(PurpleConnec
 			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
@@ -736,6 +739,8 @@ purple_connection_finalize(GObject *obje
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	gboolean remove = FALSE;
 
+	priv->is_finalizing = TRUE;
+
 	account = purple_connection_get_account(gc);
 
 	purple_debug_info("connection", "Disconnecting connection %p\n", gc);



More information about the Commits mailing list