[gimp/gimp-2-10] app: various fixes to last commit



commit dfca360b66044929aab94c34a3e5e2465c884c88
Author: Ell <ell_se yahoo com>
Date:   Wed Mar 6 15:39:29 2019 -0500

    app: various fixes to last commit
    
    (cherry picked from commit caad9ca649c1fed5e6bc9fb7a252b5eae8397c0c)

 app/core/gimplineart.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimplineart.c b/app/core/gimplineart.c
index 3a3580703b..2fcbf935e8 100644
--- a/app/core/gimplineart.c
+++ b/app/core/gimplineart.c
@@ -1148,12 +1148,13 @@ gimp_line_art_close (GeglBuffer  *buffer,
 
  end3:
           g_list_free_full (candidates, g_free);
-          g_clear_object (&strokes);
 
           if (gimp_async_is_stopped (async))
             goto end2;
         }
 
+      g_clear_object (&strokes);
+
       /* Draw straight line segments */
       if (segment_max_length > 0)
         {
@@ -1236,12 +1237,18 @@ gimp_line_art_close (GeglBuffer  *buffer,
       g_free (normals);
       g_free (curvatures);
       g_free (smoothed_curvatures);
-      g_array_free (keypoints, TRUE);
-      g_hash_table_destroy (visited);
+      g_clear_pointer (&radii, g_free);
+      if (keypoints)
+        g_array_free (keypoints, TRUE);
+      g_clear_pointer (&visited, g_hash_table_destroy);
 
       if (gimp_async_is_stopped (async))
         goto end1;
     }
+  else
+    {
+      g_clear_object (&strokes);
+    }
 
   if (closed_distmap)
     {
@@ -1321,7 +1328,7 @@ gimp_lineart_denoise (GeglBuffer *buffer,
 
             while (! g_queue_is_empty (q))
               {
-                Pixel *p = (Pixel *) g_queue_pop_head (q);
+                Pixel *p;
                 gint   p2x;
                 gint   p2y;
 
@@ -1332,6 +1339,8 @@ gimp_lineart_denoise (GeglBuffer *buffer,
                     goto end;
                   }
 
+                p = (Pixel *) g_queue_pop_head (q);
+
                 p2x = p->x + 1;
                 p2y = p->y;
                 if (p2x >= 0 && p2x < width && p2y >= 0 && p2y < height)
@@ -2652,6 +2661,8 @@ gimp_edgelset_new (GeglBuffer *buffer,
 
       if (gimp_async_is_canceled (async))
         {
+          gegl_buffer_iterator_stop (gi);
+
           gimp_async_abort (async);
 
           goto end;


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