aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-base-modem.c')
-rw-r--r--src/mm-base-modem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c
index bccf42a9..5d9782c3 100644
--- a/src/mm-base-modem.c
+++ b/src/mm-base-modem.c
@@ -1256,6 +1256,11 @@ dispose (GObject *object)
g_clear_object (&self->priv->gps_control);
g_clear_object (&self->priv->gps);
#if defined WITH_QMI
+ /* We need to close the QMI port cleanly when disposing the modem object,
+ * otherwise the allocated CIDs will be kept allocated, and if we end up
+ * allocating too many newer allocations will fail with client-ids-exhausted
+ * errors. */
+ g_list_foreach (self->priv->qmi, (GFunc)mm_qmi_port_close, NULL);
g_list_free_full (self->priv->qmi, g_object_unref);
self->priv->qmi = NULL;
#endif