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; } /* ---------------------------------------------------------------------------------------------------- */