summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-05-12 10:52:20 +0200
committerThomas Haller <thaller@redhat.com>2016-05-12 10:54:23 +0200
commitfdd793ba990cbda6411e79cd0d0d5e7306af6d91 (patch)
tree1c0f603be944c27f529d5f07d03455d76334331a
parentb4095a51011db5c58f147af05d3704169588bed4 (diff)
downloadNetworkManager-fdd793ba990cbda6411e79cd0d0d5e7306af6d91.tar.gz
wwan: cancel asyncronous request in connect_context_clear()
priv->ctx->cancellable is passed to mm_sim_send_pin() to cancel the operation. We must cancel the operation when the context/response is no longer relevant. Especially, as we don't take a reference on @self during the asyncronous request.
-rw-r--r--src/devices/wwan/nm-modem-broadband.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index c622e6cd9a..64c84aa0a8 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -288,7 +288,7 @@ connect_context_clear (NMModemBroadband *self)
g_clear_error (&ctx->first_error);
g_clear_pointer (&ctx->ip_types, (GDestroyNotify) g_array_unref);
- g_clear_object (&ctx->cancellable);
+ nm_clear_g_cancellable (&ctx->cancellable);
g_clear_object (&ctx->connection);
g_clear_object (&ctx->connect_properties);
g_clear_object (&ctx->self);
@@ -389,7 +389,7 @@ send_pin_ready (MMSim *sim, GAsyncResult *result, NMModemBroadband *self)
return;
if (!self->priv->ctx || self->priv->ctx->step != CONNECT_STEP_UNLOCK)
- return;
+ g_return_if_reached ();
if (error) {
if (g_error_matches (error, MM_MOBILE_EQUIPMENT_ERROR, MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN) ||