diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2009-07-23 22:21:12 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-07-30 06:13:19 +0800 |
commit | 43208e2ee8fe2371d0562f37d817173857a91268 (patch) | |
tree | 6b789b5aff167f73fb1926ac9dd1f5222aad988d /src | |
parent | 010828ac98b604438cd0edace9263cd120f4ad10 (diff) | |
download | gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar.gz gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar.bz2 gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar.lz gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar.xz gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.tar.zst gsoc2013-empathy-43208e2ee8fe2371d0562f37d817173857a91268.zip |
Move some code off dispose
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-dialog.c | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index bad15b974..f2b433618 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -1165,7 +1165,29 @@ accounts_dialog_response_cb (GtkWidget *widget, gint response, EmpathyAccountsDialog *dialog) { + GList *accounts, *l; + EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + if (response == GTK_RESPONSE_CLOSE) { + /* Delete incomplete accounts */ + accounts = empathy_account_manager_dup_accounts + (priv->account_manager); + for (l = accounts; l; l = l->next) { + EmpathyAccount *account; + + account = l->data; + if (!empathy_account_is_valid (account)) { + /* FIXME: Warn the user the account is not + * complete and is going to be removed. + */ + empathy_account_manager_remove + (priv->account_manager, account); + } + + g_object_unref (account); + } + g_list_free (accounts); + gtk_widget_destroy (widget); } } @@ -1250,7 +1272,6 @@ do_dispose (GObject *obj) { EmpathyAccountsDialog *dialog = EMPATHY_ACCOUNTS_DIALOG (obj); EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); - GList *accounts, *l; /* Disconnect signals */ g_signal_handlers_disconnect_by_func (priv->account_manager, @@ -1272,27 +1293,19 @@ do_dispose (GObject *obj) accounts_dialog_connection_changed_cb, dialog); - /* Delete incomplete accounts */ - accounts = empathy_account_manager_dup_accounts (priv->account_manager); - for (l = accounts; l; l = l->next) { - EmpathyAccount *account; - - account = l->data; - if (!empathy_account_is_valid (account)) { - /* FIXME: Warn the user the account is not complete - * and is going to be removed. */ - empathy_account_manager_remove (priv->account_manager, account); - } - - g_object_unref (account); - } - g_list_free (accounts); - if (priv->connecting_id) { g_source_remove (priv->connecting_id); } - g_object_unref (priv->account_manager); + if (priv->account_manager != NULL) { + g_object_unref (priv->account_manager); + priv->account_manager = NULL; + } + + if (priv->cms != NULL) { + g_object_unref (priv->cms); + priv->cms = NULL; + } } static GObject * |