From a61422761f52cc359303ec92c2cae122bdf16b4b Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 12 Jul 2021 21:51:24 +0200 Subject: [PATCH] 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 --- src/mm-iface-modem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }