From d8887019ce43e29c050f51ae9656b37bd3b262ad Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 6 Jan 2015 11:50:41 +0100 Subject: [PATCH] core: declare nm_session_monitor_get() using NM_DEFINE_SINGLETON_GETTER() --- src/nm-session-monitor.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/nm-session-monitor.c b/src/nm-session-monitor.c index 691b3a724c..050dae0e79 100644 --- a/src/nm-session-monitor.c +++ b/src/nm-session-monitor.c @@ -278,16 +278,9 @@ ck_finalize (NMSessionMonitor *monitor) /********************************************************************/ -static NMSessionMonitor * -nm_session_monitor_get (void) -{ - static NMSessionMonitor *singleton = NULL; +NMSessionMonitor *nm_session_monitor_get(void); - if (!singleton) - singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL)); - - return singleton; -} +NM_DEFINE_SINGLETON_GETTER (NMSessionMonitor, nm_session_monitor_get, NM_TYPE_SESSION_MONITOR); /** * nm_session_monitor_connect: