aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-18 17:58:59 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-18 23:57:33 +0800
commit72d258b32eddaae77992e30a127882cbaaab0be0 (patch)
tree1c4ea038e800affe0ed6691ca452ab5e2bcea659
parent07a2794768ee8fbfb2d7b5a71ea22a9ea17d7b43 (diff)
downloadgsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar.gz
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar.bz2
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar.lz
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar.xz
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.tar.zst
gsoc2013-empathy-72d258b32eddaae77992e30a127882cbaaab0be0.zip
keep a ref on the selected account
-rw-r--r--src/empathy-accounts-dialog.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 98d31b3b9..f027eccc0 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1199,6 +1199,7 @@ accounts_dialog_cms_ready_cb (EmpathyConnectionManagers *cms,
{
accounts_dialog_set_selected_account
(dialog, priv->initial_selection);
+ g_object_unref (priv->initial_selection);
priv->initial_selection = NULL;
}
}
@@ -1304,6 +1305,10 @@ do_dispose (GObject *obj)
priv->cms = NULL;
}
+ if (priv->initial_selection != NULL)
+ g_object_unref (priv->initial_selection);
+ priv->initial_selection = NULL;
+
G_OBJECT_CLASS (empathy_accounts_dialog_parent_class)->dispose (obj);
}
@@ -1488,13 +1493,16 @@ empathy_accounts_dialog_show (GtkWindow *parent,
priv = GET_PRIV (dialog);
- if (selected_account && empathy_connection_managers_is_ready (priv->cms))
- accounts_dialog_set_selected_account (dialog, selected_account);
- else
- /* save the selection to set it later when the cms
- * becomes ready.
- */
- priv->initial_selection = selected_account;
+ if (selected_account)
+ {
+ if (empathy_connection_managers_is_ready (priv->cms))
+ accounts_dialog_set_selected_account (dialog, selected_account);
+ else
+ /* save the selection to set it later when the cms
+ * becomes ready.
+ */
+ priv->initial_selection = g_object_ref (selected_account);
+ }
gtk_window_present (GTK_WINDOW (priv->window));