From b435012eb123273814e0aa61851844e749eb7a12 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 2 Dec 2011 11:47:24 +0100 Subject: [PATCH] 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. --- src/mm-sim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mm-sim.c b/src/mm-sim.c index f4833139..8b95d357 100644 --- a/src/mm-sim.c +++ b/src/mm-sim.c @@ -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);