From 0ff904b3c501969d953c05834d897211b92a1324 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 31 Jul 2012 09:16:07 +0200 Subject: [PATCH] bearer: set state as DISCONNECTING as soon as we cancel the connection sequence Just when we request to cancel the connection we need to set the bearer as being disconnected, so that we do not end up overwriting connection cancellation requests. Reported by: Thieu Le --- src/mm-bearer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mm-bearer.c b/src/mm-bearer.c index 3cce9483..6d30caea 100644 --- a/src/mm-bearer.c +++ b/src/mm-bearer.c @@ -466,6 +466,9 @@ mm_bearer_disconnect (MMBearer *self, /* If currently connecting, try to cancel that operation, and wait to get * disconnected. */ if (self->priv->status == MM_BEARER_STATUS_CONNECTING) { + /* Set ourselves as disconnecting */ + bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTING); + /* We MUST ensure that we get to DISCONNECTED */ g_cancellable_cancel (self->priv->connect_cancellable); /* Note that we only allow to remove disconnected bearers, so should