aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact-manager.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:49:56 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:49:56 +0800
commite5011edd94a51339ae21e2690fd90af652425549 (patch)
treeac9e614d11948b1fb0e38146fc6e875c5315bb2d /libempathy/empathy-contact-manager.c
parentd928abd933a716c44a6db244ea87dac566be2a5b (diff)
downloadgsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar.gz
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar.bz2
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar.lz
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar.xz
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.tar.zst
gsoc2013-empathy-e5011edd94a51339ae21e2690fd90af652425549.zip
Create the EmpathyContactMonitor lazily if needed.
svn path=/trunk/; revision=2099
Diffstat (limited to 'libempathy/empathy-contact-manager.c')
-rw-r--r--libempathy/empathy-contact-manager.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index 213c625a3..a69d6d970 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -191,7 +191,9 @@ contact_manager_finalize (GObject *object)
object);
g_object_unref (priv->account_manager);
- g_object_unref (priv->contact_monitor);
+ if (priv->contact_monitor) {
+ g_object_unref (priv->contact_monitor);
+ }
}
static void
@@ -218,7 +220,7 @@ empathy_contact_manager_init (EmpathyContactManager *manager)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) g_object_unref);
priv->account_manager = empathy_account_manager_dup_singleton ();
- priv->contact_monitor = empathy_contact_monitor_new_for_proxy (EMPATHY_CONTACT_LIST (manager));
+ priv->contact_monitor = NULL;
g_signal_connect (priv->account_manager,
"account-connection-changed",
@@ -333,6 +335,10 @@ contact_manager_get_monitor (EmpathyContactList *manager)
{
EmpathyContactManagerPriv *priv = GET_PRIV (manager);
+ if (priv->contact_monitor == NULL) {
+ priv->contact_monitor = empathy_contact_monitor_new_for_iface (manager);
+ }
+
return priv->contact_monitor;
}