iface-modem: don't process signal/act updates if interface is shut down

When the interface is shut down the skeleton object no longer exists. Given that
we're allowing this actions from outside the interface, we should be safe and
don't assume that the caller knows exactly the state of the interface.
This commit is contained in:
Aleksander Morgado
2012-08-02 09:23:16 +02:00
parent b320f5c065
commit 0336b8f89d
+12 -4
View File
@@ -529,6 +529,10 @@ mm_iface_modem_update_access_technologies (MMIfaceModem *self,
MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
NULL);
/* Don't process updates if the interface is shut down */
if (!skeleton)
return;
old_access_tech = mm_gdbus_modem_get_access_technologies (skeleton);
/* Build the new access tech */
@@ -754,6 +758,14 @@ update_signal_quality (MMIfaceModem *self,
MmGdbusModem *skeleton = NULL;
const gchar *dbus_path;
g_object_get (self,
MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
NULL);
/* Don't process updates if the interface is shut down */
if (!skeleton)
return;
if (G_UNLIKELY (!signal_quality_update_context_quark))
signal_quality_update_context_quark = (g_quark_from_static_string (
SIGNAL_QUALITY_UPDATE_CONTEXT_TAG));
@@ -772,10 +784,6 @@ update_signal_quality (MMIfaceModem *self,
/* Keep current timestamp */
ctx->last_update = time (NULL);
g_object_get (self,
MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
NULL);
/* Note: we always set the new value, even if the signal quality level
* is the same, in order to provide an up to date 'recent' flag.
* The only exception being if 'expire' is FALSE; in that case we assume