diff options
author | Ben Chan <benchan@chromium.org> | 2013-02-28 11:11:59 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-03-01 08:44:43 +0100 |
commit | f93bba25f2ef41af8f28296c8f8b2be81c42bdb6 (patch) | |
tree | d9d504201d18bb5cf951038e79d2cba3a1f2eb18 | |
parent | c79d266e627242b22a5e146ab157e34135e7a36a (diff) |
iface-modem-3gpp: clear deferred registration state update when disabling
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index fa8da1a3..1d3fdce4 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -1325,6 +1325,18 @@ periodic_registration_check_enable (MMIfaceModem3gpp *self) (GDestroyNotify)registration_check_context_free); } +static void +clear_deferred_registration_state_update (MMIfaceModem3gpp *self) +{ + RegistrationStateContext *ctx = get_registration_state_context (self); + + ctx->deferred_new_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; + if (ctx->deferred_update_id) { + g_source_remove (ctx->deferred_update_id); + ctx->deferred_update_id = 0; + } +} + /*****************************************************************************/ typedef struct _DisablingContext DisablingContext; @@ -1405,7 +1417,10 @@ interface_disabling_step (DisablingContext *ctx) ctx->step++; case DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS: + /* Disable periodic registration checks, if they were set */ periodic_registration_check_disable (ctx->self); + /* Prevent any deferred registration state update from happening after the modem is disabled */ + clear_deferred_registration_state_update (ctx->self); /* Fall down to next step */ ctx->step++; |