[gegl] Revert "buffer: stop leaking buffers whenever gegl_buffer_sample is called"
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Revert "buffer: stop leaking buffers whenever gegl_buffer_sample is called"
- Date: Mon, 8 Apr 2013 01:42:42 +0000 (UTC)
commit e9a7124a615a456e3bcb002f9811d4bd338393e9
Author: Michael Henning <drawoc darkrefraction com>
Date: Sun Apr 7 20:03:56 2013 -0400
Revert "buffer: stop leaking buffers whenever gegl_buffer_sample is called"
This reverts commit b0257438c1542a42be6a550a54c9677e8f59ead9.
gegl/buffer/gegl-buffer-access.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index c486df7..a690a6a 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1647,7 +1647,8 @@ gegl_buffer_sample (GeglBuffer *buffer,
buffer->sampler_format != format
))
{
- gegl_buffer_sample_cleanup (buffer);
+ g_object_unref (buffer->sampler);
+ buffer->sampler = NULL;
}
/* look up appropriate sampler,. */
@@ -1659,14 +1660,6 @@ gegl_buffer_sample (GeglBuffer *buffer,
NULL);
buffer->sampler_format = format;
gegl_sampler_prepare (buffer->sampler);
-
- /*
- * Hack: the sampler refs the buffer on creation. We therefore unref
- * the buffer here so it isn't leaked. Then, before the sampler is
- * freed in gegl_buffer_sample_cleanup, we ref the buffer again so
- * it isn't accidentally freed by the sampler
- */
- g_object_unref (buffer);
}
gegl_sampler_get (buffer->sampler, x, y, scale, dest, repeat_mode);
@@ -1679,9 +1672,6 @@ gegl_buffer_sample_cleanup (GeglBuffer *buffer)
if (buffer->sampler)
{
- /* Hack (see above) */
- g_object_ref (buffer);
-
g_object_unref (buffer->sampler);
buffer->sampler = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]