[empathy/gnome-2-34] empathy_theme_manager_dup_singleton: act as a proper dup singleton function
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-2-34] empathy_theme_manager_dup_singleton: act as a proper dup singleton function
- Date: Fri, 18 Feb 2011 10:16:52 +0000 (UTC)
commit ee4e14effcb1cb2b109d533c88933239c25a12c8
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Feb 18 10:57:11 2011 +0100
empathy_theme_manager_dup_singleton: act as a proper dup singleton function
libempathy-gtk/empathy-theme-manager.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c
index a5438c6..1a4f5ae 100644
--- a/libempathy-gtk/empathy-theme-manager.c
+++ b/libempathy-gtk/empathy-theme-manager.c
@@ -527,11 +527,14 @@ empathy_theme_manager_dup_singleton (void)
{
static EmpathyThemeManager *manager = NULL;
- if (!manager) {
+ if (manager == NULL) {
manager = g_object_new (EMPATHY_TYPE_THEME_MANAGER, NULL);
+ g_object_add_weak_pointer (G_OBJECT (manager), (gpointer *) &manager);
+
+ return manager;
}
- return manager;
+ return g_object_ref (manager);
}
const gchar **
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]