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



commit e996020e19535a6f56a9edef4112368f51afbebd
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.
    
    (cherry picked from commit 4575949cdfb209cc642c74f4b540dd1fbc42dbe4)

 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 a4f6639e53..7da02f326d 100644
--- a/app/tools/gimpbucketfilltool.c
+++ b/app/tools/gimpbucketfilltool.c
@@ -750,17 +750,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)
@@ -784,8 +784,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]