diff options
author | Jens Georg <mail@jensge.org> | 2014-05-25 11:49:40 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2014-05-25 11:52:14 +0200 |
commit | faeb36971e2ae972864a9da60351a498cb30ea07 (patch) | |
tree | f0c8cb0e487c2e151058fde8a8cf0c23f3db7270 | |
parent | 593746718ac469a2e5aa35c70ecbd9939d2164d8 (diff) | |
download | gupnp-faeb36971e2ae972864a9da60351a498cb30ea07.tar.gz |
More g_list_free_full
Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r-- | libgupnp/gupnp-network-manager.c | 7 | ||||
-rw-r--r-- | libgupnp/gupnp-service-introspection.c | 22 |
2 files changed, 7 insertions, 22 deletions
diff --git a/libgupnp/gupnp-network-manager.c b/libgupnp/gupnp-network-manager.c index 3b4e424..f9c304e 100644 --- a/libgupnp/gupnp-network-manager.c +++ b/libgupnp/gupnp-network-manager.c @@ -714,12 +714,7 @@ gupnp_network_manager_dispose (GObject *object) priv->manager_proxy = NULL; } - if (priv->nm_devices != NULL) { - g_list_foreach (priv->nm_devices, (GFunc) nm_device_unref, - NULL); - g_list_free (priv->nm_devices); - priv->nm_devices = NULL; - } + g_list_free_full (priv->nm_devices, (GDestroyNotify) nm_device_unref); if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); diff --git a/libgupnp/gupnp-service-introspection.c b/libgupnp/gupnp-service-introspection.c index bc19dcb..60de64d 100644 --- a/libgupnp/gupnp-service-introspection.c +++ b/libgupnp/gupnp-service-introspection.c @@ -95,10 +95,8 @@ gupnp_service_state_variable_info_free g_value_unset (&variable->maximum); g_value_unset (&variable->step); } - g_list_foreach (variable->allowed_values, - (GFunc) g_free, - NULL); - g_list_free (variable->allowed_values); + + g_list_free_full (variable->allowed_values, g_free); g_slice_free (GUPnPServiceStateVariableInfo, variable); } @@ -180,19 +178,11 @@ gupnp_service_introspection_finalize (GObject *object) introspection = GUPNP_SERVICE_INTROSPECTION (object); - if (introspection->priv->variables) { - g_list_foreach (introspection->priv->variables, - (GFunc) gupnp_service_state_variable_info_free, - NULL); - g_list_free (introspection->priv->variables); - } + g_list_free_full (introspection->priv->variables, + (GDestroyNotify) gupnp_service_state_variable_info_free); - if (introspection->priv->actions) { - g_list_foreach (introspection->priv->actions, - (GFunc) gupnp_service_action_info_free, - NULL); - g_list_free (introspection->priv->actions); - } + g_list_free_full (introspection->priv->actions, + (GDestroyNotify) gupnp_service_action_info_free); /* Contents don't need to be freed, they were owned by priv->variables */ |