pidgin/pidgin

Conversations: fix glib warnings

2014-06-12, Tomasz Wasilczyk
2e4dd08b0131
Parents 69b4fce85ffa
Children 63663622e327
Conversations: fix glib warnings
--- a/libpurple/conversation.c Thu Jun 12 18:45:07 2014 +0200
+++ b/libpurple/conversation.c Thu Jun 12 19:03:54 2014 +0200
@@ -414,7 +414,8 @@
g_free(priv->title);
priv->title = g_strdup(title);
- g_object_notify_by_pspec(G_OBJECT(conv), properties[PROP_TITLE]);
+ if (!g_object_get_data(G_OBJECT(conv), "is-finalizing"))
+ g_object_notify_by_pspec(G_OBJECT(conv), properties[PROP_TITLE]);
purple_conversation_update(conv, PURPLE_CONVERSATION_UPDATE_TITLE);
}
@@ -1133,6 +1134,12 @@
g_object_unref(account);
}
+static void
+purple_conversation_dispose(GObject *object)
+{
+ g_object_set_data(object, "is-finalizing", GINT_TO_POINTER(TRUE));
+}
+
/* GObject finalize function */
static void
purple_conversation_finalize(GObject *object)
@@ -1175,6 +1182,7 @@
parent_class = g_type_class_peek_parent(klass);
+ obj_class->dispose = purple_conversation_dispose;
obj_class->finalize = purple_conversation_finalize;
obj_class->constructed = purple_conversation_constructed;
--- a/libpurple/conversationtypes.c Thu Jun 12 18:45:07 2014 +0200
+++ b/libpurple/conversationtypes.c Thu Jun 12 19:03:54 2014 +0200
@@ -55,8 +55,6 @@
char *nick; /* Your nick in this chat. */
gboolean left; /* We left the chat and kept the window open */
GHashTable *users; /* Hash table of the users in the room. */
-
- gboolean is_finalizing; /* The object is being destroyed. */
};
/* Chat Property enums */
@@ -1291,7 +1289,7 @@
priv->left = TRUE;
- if (!priv->is_finalizing)
+ if (!g_object_get_data(G_OBJECT(chat), "is-finalizing"))
g_object_notify_by_pspec(G_OBJECT(chat), chat_properties[CHAT_PROP_LEFT]);
purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_CHATLEFT);
@@ -1467,8 +1465,6 @@
PurpleConnection *gc = purple_conversation_get_connection(PURPLE_CONVERSATION(chat));
PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat);
- priv->is_finalizing = TRUE;
-
if (gc != NULL)
{
/* Still connected */