[gimp/soc-2010-cage] app: don't leak each transformed brush mask



commit 5bbeacd732e1199d7d2054c0615b091177e5cb56
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jun 22 23:02:23 2010 +0200

    app: don't leak each transformed brush mask

 app/core/gimpbrush-transform.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpbrush-transform.c b/app/core/gimpbrush-transform.c
index ca83acf..7083ccb 100644
--- a/app/core/gimpbrush-transform.c
+++ b/app/core/gimpbrush-transform.c
@@ -167,7 +167,7 @@ gimp_brush_real_transform_mask (GimpBrush *brush,
    */
   const guint fraction_bitmask = pow(2, fraction_bits) - 1 ;
 
-  source = temp_buf_copy (brush->mask, NULL);
+  source = brush->mask;
 
   gimp_brush_transform_matrix (source->height, source->width,
                                scale, aspect_ratio, angle, &matrix);
@@ -320,6 +320,7 @@ gimp_brush_real_transform_mask (GimpBrush *brush,
         src_space_cur_pos_y = src_space_cur_pos_y_i >> fraction_bits;
 
     } /* end for y */
+
   if (hardness < 1.0)
     {
       TempBuf      *blur_src;
@@ -335,13 +336,16 @@ gimp_brush_real_transform_mask (GimpBrush *brush,
 
       blur_src = temp_buf_copy (result, NULL);
 
-      pixel_region_init_temp_buf (&srcPR, blur_src, blur_src->x, blur_src->y, blur_src->width, blur_src->height);
-      pixel_region_init_temp_buf (&destPR, result, result->x, result->y, result->width, result->height);
+      pixel_region_init_temp_buf (&srcPR, blur_src,
+                                  blur_src->x, blur_src->y,
+                                  blur_src->width, blur_src->height);
+      pixel_region_init_temp_buf (&destPR, result,
+                                  result->x, result->y,
+                                  result->width, result->height);
 
       convolve_region (&srcPR, &destPR, blur_kernel, kernel_size,
-                       gimp_brush_transform_array_sum(blur_kernel, kernel_len),
+                       gimp_brush_transform_array_sum (blur_kernel, kernel_len),
                        GIMP_NORMAL_CONVOL, FALSE);
-
     }
 
   return result;



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