summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-01-06 11:50:41 +0100
committerThomas Haller <thaller@redhat.com>2015-01-12 12:10:03 +0100
commitd8887019ce43e29c050f51ae9656b37bd3b262ad (patch)
treead42947d7ce3a9875cc0d268da4c95018c1e8086
parent22409e0481dcaf5a288ad73553cbef5e2da05207 (diff)
downloadNetworkManager-d8887019ce43e29c050f51ae9656b37bd3b262ad.tar.gz
core: declare nm_session_monitor_get() using NM_DEFINE_SINGLETON_GETTER()
-rw-r--r--src/nm-session-monitor.c11
1 files 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;
-
- if (!singleton)
- singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL));
+NMSessionMonitor *nm_session_monitor_get(void);
- return singleton;
-}
+NM_DEFINE_SINGLETON_GETTER (NMSessionMonitor, nm_session_monitor_get, NM_TYPE_SESSION_MONITOR);
/**
* nm_session_monitor_connect: