diff options
author | Dan Winship <danw@gnome.org> | 2013-11-05 14:43:31 -0500 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-12-03 16:39:37 -0500 |
commit | 37b8983c39d8dcb8402da186dbd3245b019af7a9 (patch) | |
tree | e5d5d12a628b128f22b554afc9a87a20f1b23b37 /src/nm-session-monitor-null.c | |
parent | 6e73f01b6e69f44f8d9da4872fb796b9d80acac1 (diff) | |
download | NetworkManager-37b8983c39d8dcb8402da186dbd3245b019af7a9.tar.gz |
core: make NMSessionMonitor non-refcounted
and ensure that main() frees the singleton before exiting
Diffstat (limited to 'src/nm-session-monitor-null.c')
-rw-r--r-- | src/nm-session-monitor-null.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nm-session-monitor-null.c b/src/nm-session-monitor-null.c index beabcf213e..5d8ecaaf1a 100644 --- a/src/nm-session-monitor-null.c +++ b/src/nm-session-monitor-null.c @@ -81,11 +81,8 @@ nm_session_monitor_get (void) { static NMSessionMonitor *singleton = NULL; - if (singleton) - return g_object_ref (singleton); - - singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL)); - g_assert (singleton); + if (!singleton) + singleton = g_object_new (NM_TYPE_SESSION_MONITOR, NULL); return singleton; } |