bearer: use g_clear_object() before setting new objects
This commit is contained in:
@@ -558,8 +558,7 @@ set_property (GObject *object,
|
|||||||
self->priv->path = g_value_dup_string (value);
|
self->priv->path = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
case PROP_CONNECTION:
|
case PROP_CONNECTION:
|
||||||
if (self->priv->connection)
|
g_clear_object (&self->priv->connection);
|
||||||
g_object_unref (self->priv->connection);
|
|
||||||
self->priv->connection = g_value_dup_object (value);
|
self->priv->connection = g_value_dup_object (value);
|
||||||
|
|
||||||
/* Export when we get a DBus connection */
|
/* Export when we get a DBus connection */
|
||||||
@@ -569,8 +568,7 @@ set_property (GObject *object,
|
|||||||
mm_bearer_unexport (self);
|
mm_bearer_unexport (self);
|
||||||
break;
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
if (self->priv->modem)
|
g_clear_object (&self->priv->modem);
|
||||||
g_object_unref (self->priv->modem);
|
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->modem = g_value_dup_object (value);
|
||||||
if (self->priv->modem)
|
if (self->priv->modem)
|
||||||
/* Bind the modem's connection (which is set when it is exported,
|
/* Bind the modem's connection (which is set when it is exported,
|
||||||
|
Reference in New Issue
Block a user