[glade/tintou/gwactionclass-leak] gladeui: fix memory leak in GWActionClass
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/tintou/gwactionclass-leak] gladeui: fix memory leak in GWActionClass
- Date: Mon, 1 Apr 2019 09:00:18 +0000 (UTC)
commit 2078edfe36a8253baa236e2b99353220380939ba
Author: Corentin Noël <corentin noel collabora com>
Date: Mon Apr 1 10:59:12 2019 +0200
gladeui: fix memory leak in GWActionClass
gladeui/glade-widget-action.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gladeui/glade-widget-action.c b/gladeui/glade-widget-action.c
index 5e2ee1f8..46c3d195 100644
--- a/gladeui/glade-widget-action.c
+++ b/gladeui/glade-widget-action.c
@@ -335,13 +335,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]