[gimp] app: add weak pointers for the curves and levels hisrogram view members



commit 605123d79d381da25bffc1c4d44d715df918f7c1
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 29 21:00:25 2018 +0100

    app: add weak pointers for the curves and levels hisrogram view members
    
    so we don't run into the same warnings on tool shotdown we already
    fixed for tool startup.

 app/tools/gimpcurvestool.c |    4 ++++
 app/tools/gimplevelstool.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index 71fd35c..2ed792f 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -488,6 +488,10 @@ gimp_curves_tool_dialog (GimpFilterTool *filter_tool)
   gtk_widget_show (frame);
 
   tool->graph = gimp_curve_view_new ();
+
+  g_object_add_weak_pointer (G_OBJECT (tool->graph),
+                             (gpointer) &tool->graph);
+
   gimp_curve_view_set_range_x (GIMP_CURVE_VIEW (tool->graph), 0, 255);
   gimp_curve_view_set_range_y (GIMP_CURVE_VIEW (tool->graph), 0, 255);
   gtk_widget_set_size_request (tool->graph,
diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c
index f14a477..eae3fa0 100644
--- a/app/tools/gimplevelstool.c
+++ b/app/tools/gimplevelstool.c
@@ -420,6 +420,10 @@ gimp_levels_tool_dialog (GimpFilterTool *filter_tool)
   gtk_widget_show (vbox2);
 
   tool->histogram_view = gimp_histogram_view_new (FALSE);
+
+  g_object_add_weak_pointer (G_OBJECT (tool->histogram_view),
+                             (gpointer) &tool->histogram_view);
+
   gtk_box_pack_start (GTK_BOX (vbox2), tool->histogram_view, TRUE, TRUE, 0);
   gtk_widget_show (GTK_WIDGET (tool->histogram_view));
 


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