aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-01-11 11:49:49 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-01-14 10:36:39 +0100
commit3216e7a21aa4ac07467c47c30acf961476189ac8 (patch)
tree0387c290c35b67ecaf94ed3ee7d742638c7724d4 /src
parent504d6f51a355f8f7b9c5963fa45a2788974b93cd (diff)
broadband-modem-qmi: don't pass full reference to signal handlers
As in the case of the timeouts, we should not pass a full reference as data to the signal handler as we don't know how many times we'll receive the signal or if we'll ever receive it. We already make sure that the signal handler is disconnected when the operation ends, so we can be sure the self pointer is valid while the signal handler is connected.
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem-qmi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 0c6c9e08..fb592e16 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -1793,7 +1793,6 @@ power_event_report_indication_cb (QmiClientDms *client,
MM_CORE_ERROR_FAILED,
"Invalid power indication received");
dms_set_operating_mode_complete (self, error);
- g_object_unref (self);
return;
}
@@ -1804,7 +1803,6 @@ power_event_report_indication_cb (QmiClientDms *client,
if (mode == state) {
mm_obj_dbg (self, "Requested mode and mode received by indication matched");
dms_set_operating_mode_complete (self, NULL);
- g_object_unref (self);
return;
}
@@ -1812,7 +1810,6 @@ power_event_report_indication_cb (QmiClientDms *client,
MM_CORE_ERROR_FAILED,
"Requested mode and mode received by indication did not match");
dms_set_operating_mode_complete (self, error);
- g_object_unref (self);
}
static void
@@ -1932,7 +1929,7 @@ dms_set_event_report_operating_mode_activate_ready (QmiClientDms *client,
g_signal_connect (client,
"event-report",
G_CALLBACK (power_event_report_indication_cb),
- g_object_ref (self));
+ self);
g_assert (self->priv->set_operating_mode_task != NULL);
mm_obj_dbg (self, "Power operation is pending");