diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-12 21:51:24 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-07-12 21:51:24 +0200 |
commit | a61422761f52cc359303ec92c2cae122bdf16b4b (patch) | |
tree | ae413013b249c7efccfe00d099359bac08aa8b8e | |
parent | b983deaa40b9b68c1a6684df416e38fff2328e28 (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
-rw-r--r-- | src/mm-iface-modem.c | 4 |
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; } |