[gtk+/gtk-2-24-quartz] notebook: don't leak the action widgets



commit d85212558fe0345c843b5fd8c4c020880610a03a
Author: Michael Natterer <mitch gimp org>
Date:   Thu Nov 17 00:49:42 2011 +0100

    notebook: don't leak the action widgets
    
    The notebook owns them, so it must destroy them in destroy().

 gtk/gtknotebook.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a8c8057..b203117 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1504,6 +1504,18 @@ gtk_notebook_destroy (GtkObject *object)
   GtkNotebook *notebook = GTK_NOTEBOOK (object);
   GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
+  if (priv->action_widget[GTK_PACK_START])
+    {
+      gtk_widget_unparent (priv->action_widget[GTK_PACK_START]);
+      priv->action_widget[GTK_PACK_START] = NULL;
+    }
+
+  if (priv->action_widget[GTK_PACK_END])
+    {
+      gtk_widget_unparent (priv->action_widget[GTK_PACK_END]);
+      priv->action_widget[GTK_PACK_END] = NULL;
+    }
+
   if (notebook->menu)
     gtk_notebook_popup_disable (notebook);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]