aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-07-12 21:51:24 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-07-12 21:51:24 +0200
commita61422761f52cc359303ec92c2cae122bdf16b4b (patch)
treeae413013b249c7efccfe00d099359bac08aa8b8e /src
parentb983deaa40b9b68c1a6684df416e38fff2328e28 (diff)
iface-modem: ignore warning when trying to disconnect signal handler
The signal handler may have been already removed during dispose of the modem object, which is run manually through g_object_run_dispose(). Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/399
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 92bf23e5..19eb2847 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -265,7 +265,9 @@ wait_for_final_state_context_complete (GTask *task,
* 'task' in order to prevent state_changed from being invoked, which
* invokes wait_for_final_state_context_complete again. */
if (ctx->state_changed_id) {
- g_signal_handler_disconnect (self, ctx->state_changed_id);
+ /* may be automatically disconnected during dispose */
+ if (g_signal_handler_is_connected (self, ctx->state_changed_id))
+ g_signal_handler_disconnect (self, ctx->state_changed_id);
ctx->state_changed_id = 0;
}