iface-modem: fix crashes due to removed context

This commit is contained in:
Ben Chan
2012-08-01 11:53:06 -07:00
committed by Aleksander Morgado
parent 0ff904b3c5
commit b320f5c065

View File

@@ -591,8 +591,11 @@ access_technologies_check_ready (MMIfaceModem *self,
} else } else
mm_iface_modem_update_access_technologies (self, access_technologies, mask); 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 = g_object_get_qdata (G_OBJECT (self), access_technologies_check_context_quark);
if (ctx)
ctx->running = FALSE; ctx->running = FALSE;
} }
@@ -843,8 +846,11 @@ signal_quality_check_ready (MMIfaceModem *self,
} else } else
update_signal_quality (self, signal_quality, TRUE); 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 = g_object_get_qdata (G_OBJECT (self), signal_quality_check_context_quark);
if (ctx)
ctx->running = FALSE; ctx->running = FALSE;
} }