From c95ff4de046d583fe2e8189522214069b708d32f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 14 Mar 2011 14:54:46 -0400 Subject: [PATCH] GDBusProxy: Check if connection is NULL before unreffing If no connection can be established with the bus, it is possible that the GDBusPRoxy will be finalized without having a connection object. --- gio/gdbusproxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c index 98bd758..06957f6 100644 --- a/gio/gdbusproxy.c +++ b/gio/gdbusproxy.c @@ -156,7 +156,8 @@ g_dbus_proxy_finalize (GObject *object) g_dbus_connection_signal_unsubscribe (proxy->priv->connection, proxy->priv->signals_subscriber_id); - g_object_unref (proxy->priv->connection); + if (proxy->priv->connection != NULL) + g_object_unref (proxy->priv->connection); g_free (proxy->priv->name); g_free (proxy->priv->name_owner); g_free (proxy->priv->object_path); -- 2.7.4