diff --git a/src/nm-session-monitor-null.c b/src/nm-session-monitor-null.c index ec33bef62..14d756fe2 100644 --- a/src/nm-session-monitor-null.c +++ b/src/nm-session-monitor-null.c @@ -84,7 +84,9 @@ nm_session_monitor_get (void) if (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)); + assert (singleton); + return singleton; } /* ---------------------------------------------------------------------------------------------------- */ diff --git a/src/nm-session-monitor-systemd.c b/src/nm-session-monitor-systemd.c index ae0949469..8fe73ae56 100644 --- a/src/nm-session-monitor-systemd.c +++ b/src/nm-session-monitor-systemd.c @@ -195,7 +195,9 @@ nm_session_monitor_get (void) if (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)); + assert (singleton); + return singleton; } gboolean