aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2012-07-12 14:12:52 -0700
committerAleksander Morgado <aleksander@lanedo.com>2012-07-13 08:42:05 +0200
commit9ddcf92a18f94e4d4e38c2807311ad8518b5e9a7 (patch)
tree6d51b2828670fe74418eaba1e834ca8e770322e4
parent0519af932e5306ecb6c7ae7c37bc11ab1ffbd73f (diff)
iface-modem: fix crashes due to removed skeleton
expire_signal_quality() / mm_iface_modem_update_access_technologies() may be called after the DBus object skeleton is removed in mm_iface_modem_shutdown() and before their associated timeout source is removed (in *_context_free) due to destruction of the modem object. This patch fixes the issue by removing context objects before removing the DBus skeleton in mm_iface_modem_shutdown().
-rw-r--r--src/mm-iface-modem.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 49a18a59..3373b5ba 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -3676,6 +3676,31 @@ mm_iface_modem_shutdown (MMIfaceModem *self)
{
g_return_if_fail (MM_IS_IFACE_MODEM (self));
+ /* Remove SignalQualityCheckContext object to make sure any pending
+ * invocation of periodic_signal_quality_check is cancelled before
+ * SignalQualityUpdateContext is removed (as signal_quality_check_ready may
+ * call update_signal_quality). */
+ if (G_LIKELY (signal_quality_check_context_quark))
+ g_object_set_qdata (G_OBJECT (self),
+ signal_quality_check_context_quark,
+ NULL);
+
+ /* Remove SignalQualityUpdateContext object to make sure any pending
+ * invocation of expire_signal_quality is canceled before the DBus skeleton
+ * is removed. */
+ if (G_LIKELY (signal_quality_update_context_quark))
+ g_object_set_qdata (G_OBJECT (self),
+ signal_quality_update_context_quark,
+ NULL);
+
+ /* Remove AccessTechnologiesCheckContext object to make sure any pending
+ * invocation of periodic_access_technologies_check is canceled before the
+ * DBus skeleton is removed. */
+ if (G_LIKELY (access_technologies_check_context_quark))
+ g_object_set_qdata (G_OBJECT (self),
+ access_technologies_check_context_quark,
+ NULL);
+
/* Remove SIM object */
g_object_set (self,
MM_IFACE_MODEM_SIM, NULL,