summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2012-08-01 11:53:06 -0700
committerAleksander Morgado <aleksander@lanedo.com>2012-08-02 09:18:06 +0200
commitb320f5c065e634a7fd2f98accafa164a1ccd8e1b (patch)
tree4fd94019257349e16672a8685ad6d17d680e4350
parent0ff904b3c501969d953c05834d897211b92a1324 (diff)
iface-modem: fix crashes due to removed context
-rw-r--r--src/mm-iface-modem.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index e3165f29..f0fbb82a 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -591,9 +591,12 @@ access_technologies_check_ready (MMIfaceModem *self,
} else
mm_iface_modem_update_access_technologies (self, access_technologies, mask);
- /* Remove the running tag */
+ /* Remove the running tag. Note that the context may have been removed by
+ * mm_iface_modem_shutdown when this function is invoked as a callback of
+ * load_access_technologies. */
ctx = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark);
- ctx->running = FALSE;
+ if (ctx)
+ ctx->running = FALSE;
}
static gboolean
@@ -843,9 +846,12 @@ signal_quality_check_ready (MMIfaceModem *self,
} else
update_signal_quality (self, signal_quality, TRUE);
- /* Remove the running tag */
+ /* Remove the running tag. Note that the context may have been removed by
+ * mm_iface_modem_shutdown when this function is invoked as a callback of
+ * load_signal_quality. */
ctx = g_object_get_qdata (G_OBJECT (self), signal_quality_check_context_quark);
- ctx->running = FALSE;
+ if (ctx)
+ ctx->running = FALSE;
}
static gboolean