From e116ee9d8a66254682b120744450fa397e0bfbb9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 14 Apr 2011 09:19:30 -0500 Subject: [PATCH] core: don't keep re-reading the ConsoleKit database Due to a stupid error the cache wasn't actually getting used and way more than one SessionMonitor was getting created. --- src/nm-session-monitor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nm-session-monitor.c b/src/nm-session-monitor.c index c701bdb3b0..c163ee6ada 100644 --- a/src/nm-session-monitor.c +++ b/src/nm-session-monitor.c @@ -410,9 +410,10 @@ nm_session_monitor_get (void) static NMSessionMonitor *singleton = NULL; if (singleton) - return NM_SESSION_MONITOR (g_object_ref (singleton)); + return g_object_ref (singleton); - return NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL)); + singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL)); + return singleton; } /* ---------------------------------------------------------------------------------------------------- */