summaryrefslogtreecommitdiff
authorAleksander Morgado <aleksander@lanedo.com>2012-12-12 11:55:33 (GMT)
committer Aleksander Morgado <aleksander@lanedo.com>2012-12-12 11:55:33 (GMT)
commitf20922ba9d766bfbb198a3c2e41981b4d9473cfa (patch) (side-by-side diff)
treeaddbc22444ff899d8799989c3e83a3450610bc47
parentc43c8958d09ba93909c3a2aebd691df9872a10e8 (diff)
downloadModemManager-f20922ba9d766bfbb198a3c2e41981b4d9473cfa.zip
ModemManager-f20922ba9d766bfbb198a3c2e41981b4d9473cfa.tar.gz
bearer: check if signal handler is connected before trying to disconnect it
Avoids warnings like: GLib-GObject-WARNING **: gsignal.c:2576: instance `0x78624028' has no handler with id `148'
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/mm-bearer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mm-bearer.c b/src/mm-bearer.c
index d426c72..5aa713e 100644
--- a/src/mm-bearer.c
+++ b/src/mm-bearer.c
@@ -320,15 +320,18 @@ reset_signal_handlers (MMBearer *self)
return;
if (self->priv->id_3gpp_registration_change) {
- g_signal_handler_disconnect (self->priv->modem, self->priv->id_3gpp_registration_change);
+ if (g_signal_handler_is_connected (self->priv->modem, self->priv->id_3gpp_registration_change))
+ g_signal_handler_disconnect (self->priv->modem, self->priv->id_3gpp_registration_change);
self->priv->id_3gpp_registration_change = 0;
}
if (self->priv->id_cdma1x_registration_change) {
- g_signal_handler_disconnect (self->priv->modem, self->priv->id_cdma1x_registration_change);
+ if (g_signal_handler_is_connected (self->priv->modem, self->priv->id_cdma1x_registration_change))
+ g_signal_handler_disconnect (self->priv->modem, self->priv->id_cdma1x_registration_change);
self->priv->id_cdma1x_registration_change = 0;
}
if (self->priv->id_evdo_registration_change) {
- g_signal_handler_disconnect (self->priv->modem, self->priv->id_evdo_registration_change);
+ if (g_signal_handler_is_connected (self->priv->modem, self->priv->id_evdo_registration_change))
+ g_signal_handler_disconnect (self->priv->modem, self->priv->id_evdo_registration_change);
self->priv->id_evdo_registration_change = 0;
}
}