Re: [PATCH] core: fix singleton handling in NULL/systemd session monitor



On Sat, 2012-02-04 at 21:08 +0100, Thomas Bechtold wrote:
> ---
>  src/nm-session-monitor-null.c    |    4 +++-
>  src/nm-session-monitor-systemd.c |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)

Pushed, thanks,

Dan

> diff --git a/src/nm-session-monitor-null.c b/src/nm-session-monitor-null.c
> index ec33bef..14d756f 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 ae09494..8fe73ae 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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]