aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-01-11 11:33:38 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-01-11 11:33:38 +0100
commitc3fcb66acf01266e7e911622529491c25e69c958 (patch)
tree816ecfe1008832e80b4cb3efda63c45473eea275 /src
parentfa1e581f136dcb201ea814b0a0100b350486ac28 (diff)
broadband-modem-qmi: don't pass full reference in timeouts
The timeout may not be called if we remove it earlier (e.g. if the indication is received) and therefore we must not pass a full new reference, otherwise it may get leaked. There is no problem with the validity of the self pointer in timeout callbacks because we're removing the timeout as part of the operation teardown logic.
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem-qmi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 1ff726c3..64871e74 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -1776,7 +1776,6 @@ dms_set_operating_mode_timeout_cb (MMBroadbandModemQmi *self)
MM_CORE_ERROR_FAILED,
"Operation timed out. Did not get any indication");
dms_set_operating_mode_complete (self, error);
- g_object_unref (self);
}
static void
@@ -1976,7 +1975,7 @@ dms_set_operating_mode (MMBroadbandModemQmi *self)
mm_obj_dbg (self, "Starting timeout for indication receiving for 10 seconds");
self->priv->set_operating_timeout_id = g_timeout_add_seconds (10,
(GSourceFunc) dms_set_operating_mode_timeout_cb,
- g_object_ref (self));
+ self);
}
static void