summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-08-02 09:23:16 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-02 09:23:16 +0200
commit0336b8f89d83998323643e5db8478590f310c256 (patch)
treeaff067c4b8fc27ae60c345d0ac68b8d74a351b5e
parentb320f5c065e634a7fd2f98accafa164a1ccd8e1b (diff)
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.
-rw-r--r--src/mm-iface-modem.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index f0fbb82a..4e3378f6 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -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