/soc/2013/ankitkv/gobjectification: 61cb35479ea9: Moved purple_a...

Ankit Vani a at nevitus.org
Sun Jun 30 10:40:08 EDT 2013


Changeset: 61cb35479ea914562d9ab51e94fe71603adbfe15
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-30 20:09 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/61cb35479ea9

Description:

Moved purple_account_constructed() above dispose and finalize

diffstat:

 libpurple/account.c |  144 ++++++++++++++++++++++++++--------------------------
 1 files changed, 72 insertions(+), 72 deletions(-)

diffs (161 lines):

diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -2898,78 +2898,6 @@ static void purple_account_init(GTypeIns
 	PURPLE_DBUS_REGISTER_POINTER(account, PurpleAccount);
 }
 
-/* GObject dispose function */
-static void
-purple_account_dispose(GObject *object)
-{
-	GList *l;
-	PurpleAccount *account = PURPLE_ACCOUNT(object);
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-
-	purple_debug_info("account", "Destroying account %p\n", account);
-	purple_signal_emit(purple_accounts_get_handle(), "account-destroying",
-						account);
-
-	for (l = purple_conversations_get_all(); l != NULL; l = l->next)
-	{
-		PurpleConversation *conv = (PurpleConversation *)l->data;
-
-		if (purple_conversation_get_account(conv) == account)
-			purple_conversation_set_account(conv, NULL);
-	}
-
-	purple_account_set_status_types(account, NULL);
-
-	if (priv->proxy_info)
-		purple_proxy_info_destroy(priv->proxy_info);
-
-	if (priv->presence)
-		purple_presence_destroy(priv->presence);
-
-	if(priv->system_log)
-		purple_log_free(priv->system_log);
-
-	if (priv->current_error) {
-		g_free(priv->current_error->description);
-		g_free(priv->current_error);
-	}
-
-	PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error);
-	PURPLE_DBUS_UNREGISTER_POINTER(account);
-
-	parent_class->dispose(object);
-}
-
-/* GObject finalize function */
-static void
-purple_account_finalize(GObject *object)
-{
-	PurpleAccount *account = PURPLE_ACCOUNT(object);
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-
-	g_free(priv->username);
-	g_free(priv->alias);
-	purple_str_wipe(priv->password);
-	g_free(priv->user_info);
-	g_free(priv->buddy_icon_path);
-	g_free(priv->protocol_id);
-
-	g_hash_table_destroy(priv->settings);
-	g_hash_table_destroy(priv->ui_settings);
-
-	while (priv->deny) {
-		g_free(priv->deny->data);
-		priv->deny = g_slist_delete_link(priv->deny, priv->deny);
-	}
-
-	while (priv->permit) {
-		g_free(priv->permit->data);
-		priv->permit = g_slist_delete_link(priv->permit, priv->permit);
-	}
-
-	parent_class->finalize(object);
-}
-
 /* Called when done constructing */
 static void
 purple_account_constructed(GObject *object)
@@ -3014,6 +2942,78 @@ purple_account_constructed(GObject *obje
 										TRUE);
 }
 
+/* GObject dispose function */
+static void
+purple_account_dispose(GObject *object)
+{
+	GList *l;
+	PurpleAccount *account = PURPLE_ACCOUNT(object);
+	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+
+	purple_debug_info("account", "Destroying account %p\n", account);
+	purple_signal_emit(purple_accounts_get_handle(), "account-destroying",
+						account);
+
+	for (l = purple_conversations_get_all(); l != NULL; l = l->next)
+	{
+		PurpleConversation *conv = (PurpleConversation *)l->data;
+
+		if (purple_conversation_get_account(conv) == account)
+			purple_conversation_set_account(conv, NULL);
+	}
+
+	purple_account_set_status_types(account, NULL);
+
+	if (priv->proxy_info)
+		purple_proxy_info_destroy(priv->proxy_info);
+
+	if (priv->presence)
+		purple_presence_destroy(priv->presence);
+
+	if(priv->system_log)
+		purple_log_free(priv->system_log);
+
+	if (priv->current_error) {
+		g_free(priv->current_error->description);
+		g_free(priv->current_error);
+	}
+
+	PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error);
+	PURPLE_DBUS_UNREGISTER_POINTER(account);
+
+	parent_class->dispose(object);
+}
+
+/* GObject finalize function */
+static void
+purple_account_finalize(GObject *object)
+{
+	PurpleAccount *account = PURPLE_ACCOUNT(object);
+	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+
+	g_free(priv->username);
+	g_free(priv->alias);
+	purple_str_wipe(priv->password);
+	g_free(priv->user_info);
+	g_free(priv->buddy_icon_path);
+	g_free(priv->protocol_id);
+
+	g_hash_table_destroy(priv->settings);
+	g_hash_table_destroy(priv->ui_settings);
+
+	while (priv->deny) {
+		g_free(priv->deny->data);
+		priv->deny = g_slist_delete_link(priv->deny, priv->deny);
+	}
+
+	while (priv->permit) {
+		g_free(priv->permit->data);
+		priv->permit = g_slist_delete_link(priv->permit, priv->permit);
+	}
+
+	parent_class->finalize(object);
+}
+
 /* Class initializer function */
 static void
 purple_account_class_init(PurpleAccountClass *klass)



More information about the Commits mailing list