aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-08 12:26:53 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-08 12:26:53 +0200
commit08eb8c22e8634b52dd3d958556abed721eacc760 (patch)
treec17324f2e61e11fa61a3e5511ed6a4ee22d67511 /src/mm-base-modem.c
parent13fa73f66677062f254f1c5e25eb874047012d96 (diff)
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.
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