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.
This commit is contained in:
Aleksander Morgado
2012-10-08 12:26:53 +02:00
parent 13fa73f666
commit 08eb8c22e8

View File

@@ -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