From 08eb8c22e8634b52dd3d958556abed721eacc760 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 8 Oct 2012 12:26:53 +0200 Subject: [PATCH] base-modem: cleanly close the QMI port to get the CIDs released If we end up allocating too many CIDs without releasing them new allocations will fail with client-ids-exhausted errors. This usually happens specially when debugging/developing as you're all the time Ctrl+C-ing the daemon without rebooting the system. --- src/mm-base-modem.c | 5 +++++ 1 file changed, 5 insertions(+) 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