aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-contact-manager.c')
-rw-r--r--libempathy/empathy-contact-manager.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index cf5a81fe2..50ed576b5 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -28,7 +28,6 @@
#include <libtelepathy/tp-constants.h>
#include "empathy-contact-manager.h"
-#include "empathy-session.h"
#include "gossip-utils.h"
#include "gossip-debug.h"
@@ -175,7 +174,16 @@ contact_manager_finalize (GObject *object)
EmpathyContactManager *
empathy_contact_manager_new (void)
{
- return g_object_new (EMPATHY_TYPE_CONTACT_MANAGER, NULL);
+ static EmpathyContactManager *manager = NULL;
+
+ if (!manager) {
+ manager = g_object_new (EMPATHY_TYPE_CONTACT_MANAGER, NULL);
+ g_object_add_weak_pointer (G_OBJECT (manager), (gpointer) &manager);
+ } else {
+ g_object_ref (manager);
+ }
+
+ return manager;
}
void