[gtk/matthiasc/for-master-2: 14/16] widget: Fix a memory leak with class actions
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master-2: 14/16] widget: Fix a memory leak with class actions
- Date: Wed, 5 Feb 2020 06:04:50 +0000 (UTC)
commit c503c8c6ed7ca85d6d5b853518b137389429dbc7
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 5 00:24:14 2020 +0100
widget: Fix a memory leak with class actions
This code was doing the wrong thing even if the parent class
doesn't have actions.
gtk/gtkwidget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d93b4b13a5..1ddee3026e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12957,9 +12957,9 @@ gtk_widget_class_add_action (GtkWidgetClass *widget_class,
if (priv->actions == NULL)
priv->actions = g_ptr_array_new ();
- else if (GTK_IS_WIDGET_CLASS (&widget_class->parent_class))
+ else
{
- GtkWidgetClass *parent_class = GTK_WIDGET_CLASS (&widget_class->parent_class);
+ GtkWidgetClass *parent_class = GTK_WIDGET_CLASS (g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS
(widget_class))));
GtkWidgetClassPrivate *parent_priv = parent_class->priv;
GPtrArray *parent_actions = parent_priv->actions;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]