diff options
Diffstat (limited to 'plugins/mm-modem-option-utils.c')
-rw-r--r-- | plugins/mm-modem-option-utils.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/plugins/mm-modem-option-utils.c b/plugins/mm-modem-option-utils.c index 35dd1ac..61ca5d1 100644 --- a/plugins/mm-modem-option-utils.c +++ b/plugins/mm-modem-option-utils.c @@ -32,6 +32,11 @@ option_get_allowed_mode_done (MMAtSerialPort *port, MMCallbackInfo *info = (MMCallbackInfo *) user_data; gboolean parsed = FALSE; + /* If the modem has already been removed, return without + * scheduling callback */ + if (mm_callback_info_check_modem_removed (info)) + return; + if (error) info->error = g_error_copy (error); else if (!g_str_has_prefix (response->str, "_OPSYS: ")) { @@ -95,6 +100,11 @@ option_set_allowed_mode_done (MMAtSerialPort *port, { MMCallbackInfo *info = (MMCallbackInfo *) user_data; + /* If the modem has already been removed, return without + * scheduling callback */ + if (mm_callback_info_check_modem_removed (info)) + return; + if (error) info->error = g_error_copy (error); @@ -357,8 +367,14 @@ unsolicited_msg_done (MMAtSerialPort *port, { MMCallbackInfo *info = user_data; - if (info) + if (info) { + /* If the modem has already been removed, return without + * scheduling callback */ + if (mm_callback_info_check_modem_removed (info)) + return; + mm_callback_info_chain_complete_one (info); + } } static void @@ -394,6 +410,11 @@ get_act_octi_request_done (MMAtSerialPort *port, MMModemGsmAccessTech octi = MM_MODEM_GSM_ACCESS_TECH_UNKNOWN; MMModemGsmAccessTech owcti; + /* If the modem has already been removed, return without + * scheduling callback */ + if (mm_callback_info_check_modem_removed (info)) + return; + if (!error) { if (parse_octi_response (response, &octi)) { /* If no 3G tech yet or current tech isn't 3G, then 2G tech is the best */ @@ -416,6 +437,11 @@ get_act_owcti_request_done (MMAtSerialPort *port, MMModemGsmAccessTech owcti = MM_MODEM_GSM_ACCESS_TECH_UNKNOWN; const char *p; + /* If the modem has already been removed, return without + * scheduling callback */ + if (mm_callback_info_check_modem_removed (info)) + return; + if (!error) { p = mm_strip_tag (response->str, "_OWCTI:"); if (owcti_to_mm (*p, &owcti)) { |