summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2019-04-01 10:59:12 +0200
committerAlberto Fanjul <albertofanjul@gmail.com>2019-04-01 23:17:23 +0200
commite7f0a4d17ac3bee6e7b7801ddffd98e4f6fea37b (patch)
tree94cf9284013903c6c37aac9751679caace578a27
parente1af8a18b2a7fcc05a064ed18223e9422670cb24 (diff)
downloadglade-e7f0a4d17ac3bee6e7b7801ddffd98e4f6fea37b.tar.gz
gladeui: fix memory leak in GWActionClass
-rw-r--r--gladeui/glade-widget-action.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gladeui/glade-widget-action.c b/gladeui/glade-widget-action.c
index 0484345c..8535bc61 100644
--- a/gladeui/glade-widget-action.c
+++ b/gladeui/glade-widget-action.c
@@ -342,13 +342,15 @@ void
glade_widget_action_class_free (GWActionClass *action)
{
if (action->actions)
- g_list_foreach (action->actions, (GFunc) glade_widget_action_class_free,
- NULL);
+ {
+ g_list_free_full (action->actions, (GDestroyNotify) glade_widget_action_class_free);
+ action->actions = NULL;
+ }
/* Dont free id since it points into path directly */
- g_free (action->path);
- g_free (action->label);
- g_free (action->stock);
+ g_clear_pointer (&action->path, g_free);
+ g_clear_pointer (&action->label, g_free);
+ g_clear_pointer (&action->stock, g_free);
g_slice_free (GWActionClass, action);
}