diff options
author | Thomas Haller <thaller@redhat.com> | 2016-05-12 10:52:20 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-05-12 12:12:54 +0200 |
commit | 80a2b27da9ed54091217e2ae25218454800986b4 (patch) | |
tree | 1a0d975d007e4fa5d67395f66b729a3cd693665a | |
parent | eede9a7c78dd6234c86051932693e284711279d0 (diff) | |
download | NetworkManager-80a2b27da9ed54091217e2ae25218454800986b4.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.c | 4 |
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) || |