core: make NMSessionMonitor non-refcounted
and ensure that main() frees the singleton before exiting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user