core, plugins: if modem removed don't process response

We try to avoid a memory leak when info->error is reset, as well as a second
re-schedule of the info.
This commit is contained in:
Aleksander Morgado
2011-05-16 12:16:04 +02:00
parent f7dff81eec
commit 9323daec01
26 changed files with 1030 additions and 300 deletions

View File

@@ -33,25 +33,6 @@ static void impl_modem_factory_reset (MMModem *modem, const char *code, DBusGMet
#include "mm-modem-glue.h"
/* Should be used from callbacks to check whether the modem was removed after
* the callback's operation was started, but before the callback itself was
* called, in which case the MMModem passed to the callback is NULL.
*/
GError *
mm_modem_check_removed (MMModem *self, const GError *error)
{
if (!self) {
/* If the modem was NULL, the error *should* have been
* MM_MODEM_ERROR_REMOVED. If it wasn't, make it that.
*/
return g_error_new_literal (MM_MODEM_ERROR,
MM_MODEM_ERROR_REMOVED,
"The modem was removed.");
}
return error ? g_error_copy (error) : NULL;
}
static void
async_op_not_supported (MMModem *self,
MMModemFn callback,