[gimp/gimp-2-10] app: in gimp_projection_chunk_render_start(), don't leak empty region



commit f21eec319fdc5ed70df0b42a24228b5462c7abad
Author: Ell <ell_se yahoo com>
Date:   Sat Jan 12 08:14:40 2019 -0500

    app: in gimp_projection_chunk_render_start(), don't leak empty region
    
    In gimp_projection_chunk_render_start(), don't leak the current
    update region when it's empty, but not NULL, and properly shut down
    the idle source.
    
    (cherry picked from commit 0e5de9576056a3262638e1aa5a23ca2a450d335a)

 app/core/gimpprojection.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 3949a9f5ee..894e5907bd 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -741,6 +741,17 @@ gimp_projection_chunk_render_start (GimpProjection *proj)
             proj, NULL);
         }
     }
+  else
+    {
+      if (region)
+        cairo_region_destroy (region);
+
+      if (proj->priv->idle_id)
+        {
+          g_source_remove (proj->priv->idle_id);
+          proj->priv->idle_id = 0;
+        }
+    }
 }
 
 static void


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