[gegl] memory leak in gegl-processor
- From: Victor Matheus de Araujo Oliveira <vmaolive src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] memory leak in gegl-processor
- Date: Sun, 25 Mar 2012 18:42:28 +0000 (UTC)
commit 4a04a77f34d546cd6c4704855881405f30b2f28d
Author: Victor Oliveira <victormatheus gmail com>
Date: Sun Mar 25 15:40:56 2012 -0300
memory leak in gegl-processor
gegl/process/gegl-processor.c | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 772f154..f312ee9 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -749,23 +749,28 @@ gegl_processor_work (GeglProcessor *processor,
gboolean more_work = FALSE;
GeglCache *cache = gegl_node_get_cache (processor->input);
- /* OpenCL params */
- GeglVisitor *visitor = g_object_new (GEGL_TYPE_VISITOR, NULL);
- GSList *iterator = NULL;
- GSList *visits_list = NULL;
- gegl_visitor_reset (visitor);
- gegl_visitor_dfs_traverse (visitor, GEGL_VISITABLE (processor->node));
- visits_list = gegl_visitor_get_visits_list (visitor);
-
- if (gegl_cl_is_accelerated () && gegl_config()->use_opencl)
- for (iterator = visits_list; iterator; iterator = iterator->next)
- {
- GeglNode *node = (GeglNode*) iterator->data;
- if (GEGL_OPERATION_GET_CLASS(node->operation)->opencl_support)
- {
- processor->chunk_size = INT_MAX;
- }
- }
+ if (gegl_cl_is_accelerated () && gegl_config()->use_opencl
+ && processor->chunk_size < INT_MAX)
+ {
+ GeglVisitor *visitor = g_object_new (GEGL_TYPE_VISITOR, NULL);
+ GSList *iterator = NULL;
+ GSList *visits_list = NULL;
+ gegl_visitor_reset (visitor);
+ gegl_visitor_dfs_traverse (visitor, GEGL_VISITABLE (processor->node));
+ visits_list = gegl_visitor_get_visits_list (visitor);
+
+ for (iterator = visits_list; iterator; iterator = iterator->next)
+ {
+ GeglNode *node = (GeglNode*) iterator->data;
+ if (GEGL_OPERATION_GET_CLASS(node->operation)->opencl_support)
+ {
+ processor->chunk_size = INT_MAX;
+ break;
+ }
+ }
+
+ g_object_unref (visitor);
+ }
more_work = gegl_processor_render (processor, &processor->rectangle, progress);
if (more_work)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]