[gegl/gsoc2009-gpu] gegl-buffer-access.c: fix memory leak in gegl_buffer_gpu_iterate()
- From: Jerson Michael Perpetua <jperpetua src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gegl/gsoc2009-gpu] gegl-buffer-access.c: fix memory leak in gegl_buffer_gpu_iterate()
- Date: Sat, 22 Aug 2009 18:25:15 +0000 (UTC)
commit 2c01dd9faef2f100d3021475121a48354610f7ee
Author: Jerson Michael Perpetua <jersonperpetua gmail com>
Date: Sun Aug 23 00:37:32 2009 +0800
gegl-buffer-access.c: fix memory leak in gegl_buffer_gpu_iterate()
gegl-buffer-access.c: fix memory leak in gegl_buffer_gpu_iterate() where
the abyss rectangles aren't allocated and destroyed properly.
gegl/buffer/gegl-buffer-access.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 9d499f7..5ed6c57 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -910,19 +910,18 @@ gegl_buffer_gpu_iterate (GeglBuffer *buffer,
GeglRegion *abyss_region = gegl_region_rectangle (&original_rect);
GeglRegion *texture_region = gegl_region_rectangle (&texture_rect);
- GeglRectangle **abyss_rects = g_new (GeglRectangle *, 1);
+ GeglRectangle *abyss_rects;
gint rect_count;
gegl_region_subtract (abyss_region, texture_region);
gegl_region_destroy (texture_region);
- gegl_region_get_rectangles (abyss_region, abyss_rects, &rect_count);
+ gegl_region_get_rectangles (abyss_region, &abyss_rects, &rect_count);
for (cnt = 0; cnt < rect_count; cnt++)
- {
- gegl_gpu_texture_clear (texture, abyss_rects[cnt]);
- g_free (abyss_rects[cnt]);
- }
+ gegl_gpu_texture_clear (texture, &abyss_rects[cnt]);
+
+ g_free (abyss_rects);
gegl_region_destroy (abyss_region);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]