[gegl] operations: displace: fix potential leaks for aux and aux2 buffers
- From: Thomas Manni <tmanni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations: displace: fix potential leaks for aux and aux2 buffers
- Date: Sat, 30 May 2015 17:35:51 +0000 (UTC)
commit c129825bdfba24f564ea2e85181a8ff56b2bf26a
Author: Thomas Manni <thomas manni free fr>
Date: Sat May 30 19:17:58 2015 +0200
operations: displace: fix potential leaks for aux and aux2 buffers
operations/common/displace.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/operations/common/displace.c b/operations/common/displace.c
index 24f662b..1190378 100644
--- a/operations/common/displace.c
+++ b/operations/common/displace.c
@@ -305,6 +305,7 @@ process (GeglOperation *operation,
}
g_free (in_pixel);
+ g_object_unref (in_sampler);
return TRUE;
}
@@ -317,15 +318,12 @@ operation_process (GeglOperation *operation,
gint level)
{
GeglProperties *o = GEGL_PROPERTIES (operation);
- GeglBuffer *input;
+ GeglBuffer *input = NULL;
GeglBuffer *aux;
GeglBuffer *aux2;
GeglBuffer *output;
gboolean success;
- const GeglRectangle *in_rect =
- gegl_operation_source_get_bounding_box (operation, "input");
-
aux = gegl_operation_context_get_source (context, "aux");
aux2 = gegl_operation_context_get_source (context, "aux2");
@@ -335,16 +333,15 @@ operation_process (GeglOperation *operation,
gpointer in = gegl_operation_context_get_object (context, "input");
gegl_operation_context_take_object (context, "output",
g_object_ref (G_OBJECT (in)));
- return TRUE;
+ success = TRUE;
}
+ else
+ {
+ input = gegl_operation_context_get_source (context, "input");
+ output = gegl_operation_context_get_target (context, "output");
- input = gegl_operation_context_get_source (context, "input");
- output = gegl_operation_context_get_output_maybe_in_place (operation,
- context,
- input,
- result);
-
- success = process (operation, input, aux, aux2, output, result, level);
+ success = process (operation, input, aux, aux2, output, result, level);
+ }
if (input != NULL)
g_object_unref (input);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]