[gegl] Revert commit 5658532 it is causing a buffer leak



commit 7f05c5840522a82861e99ad2a1ebdd1dea36ae4e
Author: �yvind Kolås <pippin gimp org>
Date:   Sat Nov 14 18:23:18 2009 +0000

    Revert commit 5658532 it is causing a buffer leak

 gegl/operation/gegl-operation-context.c |    5 ++---
 gegl/operation/gegl-operation.c         |    4 +---
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-context.c b/gegl/operation/gegl-operation-context.c
index 3a5f8cd..1fbc65c 100644
--- a/gegl/operation/gegl-operation-context.c
+++ b/gegl/operation/gegl-operation-context.c
@@ -324,8 +324,7 @@ gegl_operation_context_get_source (GeglOperationContext *context,
   return input;
 }
 
-GeglBuffer *gegl_buffer_emptybuf (void);
-GeglBuffer *gegl_buffer_emptybuf (void)
+static GeglBuffer *emptybuf (void)
 {
   static GeglBuffer *empty = NULL; /* we leak this single empty buffer,
                                       avoiding having to create it weighs
@@ -371,7 +370,7 @@ gegl_operation_context_get_target (GeglOperationContext *context,
   if (result->width == 0 ||
       result->height == 0)
     {
-      output = g_object_ref (gegl_buffer_emptybuf());
+      output = g_object_ref (emptybuf());
     }
   else if (node->dont_cache == FALSE &&
       ! GEGL_OPERATION_CLASS (G_OBJECT_GET_CLASS (operation))->no_cache)
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index 6505976..8df8e70 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -100,8 +100,6 @@ gegl_operation_create_pad (GeglOperation *self,
   gegl_node_add_pad (self->node, pad);
 }
 
-GeglBuffer *gegl_buffer_emptybuf (void);
-
 gboolean
 gegl_operation_process (GeglOperation       *operation,
                         GeglOperationContext     *context,
@@ -117,7 +115,7 @@ gegl_operation_process (GeglOperation       *operation,
   if (!strcmp (output_pad, "output") &&
       (result->width == 0 || result->height == 0))
     {
-      GeglBuffer *output = g_object_ref (gegl_buffer_emptybuf ());
+      GeglBuffer *output = gegl_buffer_new (NULL, NULL);
       gegl_operation_context_take_object (context, "output", G_OBJECT (output));
       return TRUE;
     }



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