sim: make sure we unexport the SIM object when destroying it

Usually, if not always, the connection stored in the SIM object never exists
when disposing it, as we clear the connection property in the Modem object
before destroying it, and both properties are bound. But just in case, in order
to avoid ending up with a zombie object in DBus, we make sure we unexport it.
This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:32 +01:00
parent a2f0814fc5
commit b435012eb1
+5 -1
View File
@@ -1185,8 +1185,12 @@ dispose (GObject *object)
{
MMSim *self = MM_SIM (object);
if (self->priv->connection)
if (self->priv->connection) {
/* If we arrived here with a valid connection, make sure we unexport
* the object */
mm_sim_unexport (self);
g_clear_object (&self->priv->connection);
}
if (self->priv->modem)
g_clear_object (&self->priv->modem);