diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-bearer-list.c | 5 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 3 | ||||
-rw-r--r-- | src/mm-iface-modem-simple.c | 5 | ||||
-rw-r--r-- | src/mm-modem-helpers.c | 6 |
4 files changed, 5 insertions, 14 deletions
diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index 9fd38409..d64b4ec6 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -135,10 +135,7 @@ mm_bearer_list_delete_all_bearers (MMBearerList *self) if (!self->priv->bearers) return; - g_list_foreach (self->priv->bearers, - (GFunc)g_object_unref, - NULL); - g_list_free (self->priv->bearers); + g_list_free_full (self->priv->bearers, (GDestroyNotify) g_object_unref); self->priv->bearers = NULL; } diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index cc3cf76d..c5a68756 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -916,8 +916,7 @@ disconnect_3gpp_bearers_context_complete_and_free (Disconnect3gppBearersContext if (ctx->current) g_object_unref (ctx->current); - g_list_foreach (ctx->bearers, (GFunc)g_object_unref, NULL); - g_list_free (ctx->bearers); + g_list_free_full (ctx->bearers, (GDestroyNotify) g_object_unref); g_object_unref (ctx->result); g_free (ctx); } diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index 635e127d..e704489e 100644 --- a/src/mm-iface-modem-simple.c +++ b/src/mm-iface-modem-simple.c @@ -442,10 +442,7 @@ disconnection_context_free (DisconnectionContext *ctx) g_free (ctx->bearer_path); if (ctx->current) g_object_unref (ctx->current); - if (ctx->bearers) { - g_list_foreach (ctx->bearers, (GFunc)g_object_unref, NULL); - g_list_free (ctx->bearers); - } + g_list_free_full (ctx->bearers, (GDestroyNotify) g_object_unref); g_free (ctx); } diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 53aebb82..ded11b03 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -57,8 +57,7 @@ mm_3gpp_network_info_free (MM3gppNetworkInfo *info) void mm_3gpp_network_info_list_free (GList *info_list) { - g_list_foreach (info_list, (GFunc)mm_3gpp_network_info_free, NULL); - g_list_free (info_list); + g_list_free_full (info_list, (GDestroyNotify) mm_3gpp_network_info_free); } static MMModemAccessTechnology @@ -318,8 +317,7 @@ mm_3gpp_pdp_context_free (MM3gppPdpContext *pdp) void mm_3gpp_pdp_context_list_free (GList *list) { - g_list_foreach (list, (GFunc)mm_3gpp_pdp_context_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) mm_3gpp_pdp_context_free); } static gint |