[gimp] app: in the bucket-fill tool, avoid CRITICALs when computing line-art ...



commit 4575949cdfb209cc642c74f4b540dd1fbc42dbe4
Author: Ell <ell_se yahoo com>
Date:   Mon Nov 19 10:50:48 2018 -0500

    app: in the bucket-fill tool, avoid CRITICALs when computing line-art ...
    
    ... when the current image/drawable are NULL.

 app/tools/gimpbucketfilltool.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c
index f5e5ab5e7e..313f474f22 100644
--- a/app/tools/gimpbucketfilltool.c
+++ b/app/tools/gimpbucketfilltool.c
@@ -747,17 +747,17 @@ gimp_bucket_fill_compute_line_art (GimpBucketFillTool *tool)
       if (image && options->sample_merged)
         {
           pickable = GIMP_PICKABLE (image);
-          g_object_unref (drawable);
+          g_clear_object (&drawable);
         }
       else if (drawable && ! options->sample_merged)
         {
           pickable = GIMP_PICKABLE (drawable);
-          g_object_unref (image);
+          g_clear_object (&image);
         }
       else
         {
-          g_object_unref (image);
-          g_object_unref (drawable);
+          g_clear_object (&image);
+          g_clear_object (&drawable);
         }
 
       if (pickable)
@@ -781,8 +781,6 @@ gimp_bucket_fill_compute_line_art (GimpBucketFillTool *tool)
                                    (GimpAsyncCallback) gimp_bucket_fill_compute_line_art_cb,
                                    tool);
         }
-      else
-        g_object_unref (pickable);
     }
 }
 


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