libnm-glib: fix demarshalling of ActiveConnection property in NMDevice

This commit is contained in:
Jiří Klimeš
2011-11-24 14:11:52 +01:00
parent 0dc11be8da
commit 43b3466b14

View File

@@ -264,12 +264,10 @@ demarshal_active_connection (NMObject *object, GParamSpec *pspec, GValue *value,
NMActiveConnection *active = NULL; NMActiveConnection *active = NULL;
DBusGConnection *connection; DBusGConnection *connection;
if (value) {
if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
return FALSE; return FALSE;
priv->got_active_connection = TRUE;
if (value) {
path = g_value_get_boxed (value); path = g_value_get_boxed (value);
if (path) { if (path) {
active = NM_ACTIVE_CONNECTION (_nm_object_cache_get (path)); active = NM_ACTIVE_CONNECTION (_nm_object_cache_get (path));
@@ -280,6 +278,8 @@ demarshal_active_connection (NMObject *object, GParamSpec *pspec, GValue *value,
} }
} }
priv->got_active_connection = TRUE;
if (priv->active_connection) { if (priv->active_connection) {
g_object_unref (priv->active_connection); g_object_unref (priv->active_connection);
priv->active_connection = NULL; priv->active_connection = NULL;