[gegl] remove wrappers for g_object_unref



commit a6c6b5fd99f33f04608b05cd0930a22bc3f8603e
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Thu Mar 29 21:31:23 2012 +0100

    remove wrappers for g_object_unref
    
    GEGL is a gobject API, having the wrappers for unreffing objects might lead to
    inconsistencies.

 gegl/buffer/gegl-buffer.c                 |    8 --------
 gegl/buffer/gegl-buffer.h                 |   10 ----------
 gegl/gegl.h                               |    9 ---------
 gegl/graph/gegl-node.c                    |    4 ++--
 gegl/process/gegl-processor.c             |   11 -----------
 tests/simple/test-change-processor-rect.c |    2 +-
 6 files changed, 3 insertions(+), 41 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer.c b/gegl/buffer/gegl-buffer.c
index 0959992..6d99861 100644
--- a/gegl/buffer/gegl-buffer.c
+++ b/gegl/buffer/gegl-buffer.c
@@ -1100,14 +1100,6 @@ gegl_buffer_create_sub_buffer (GeglBuffer          *buffer,
 }
 
 
-void
-gegl_buffer_destroy (GeglBuffer *buffer)
-{
-  g_return_if_fail (GEGL_IS_BUFFER (buffer));
-
-  g_object_unref (buffer);
-}
-
 typedef struct TileStorageCacheItem {
   GeglTileStorage *storage;
   gboolean         ram;
diff --git a/gegl/buffer/gegl-buffer.h b/gegl/buffer/gegl-buffer.h
index 7f50429..c35dfa6 100644
--- a/gegl/buffer/gegl-buffer.h
+++ b/gegl/buffer/gegl-buffer.h
@@ -135,16 +135,6 @@ GeglBuffer *    gegl_buffer_create_sub_buffer (GeglBuffer          *buffer,
                                                const GeglRectangle *extent);
 
 /**
- * gegl_buffer_destroy:
- * @buffer: the buffer we're done with.
- *
- * Destroys a buffer and frees up the resources used by a buffer, internally
- * this is done with reference counting and gobject, and gegl_buffer_destroy
- * is a thin wrapper around g_object_unref.
- **/
-void            gegl_buffer_destroy           (GeglBuffer          *buffer);
-
-/**
  * gegl_buffer_get_extent:
  * @buffer: the buffer to operate on.
  *
diff --git a/gegl/gegl.h b/gegl/gegl.h
index 599b45e..2c0803e 100644
--- a/gegl/gegl.h
+++ b/gegl/gegl.h
@@ -810,15 +810,6 @@ gboolean       gegl_processor_work          (GeglProcessor *processor,
                                              gdouble       *progress);
 
 
-/**
- * gegl_processor_destroy:
- * @processor: a #GeglProcessor
- *
- * Frees up resources used by a processing handle.
- */
-void           gegl_processor_destroy       (GeglProcessor *processor);
-
-
 /***
  * GeglConfig:
  *
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 3be7a1a..bb864b3 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -244,7 +244,7 @@ gegl_node_dispose (GObject *gobject)
 
   if (self->priv->processor)
     {
-      gegl_processor_destroy (self->priv->processor);
+      g_object_unref (self->priv->processor);
       self->priv->processor = NULL;
     }
   G_OBJECT_CLASS (gegl_node_parent_class)->dispose (gobject);
@@ -1747,7 +1747,7 @@ gegl_node_process (GeglNode *self)
   processor = gegl_node_new_processor (self, NULL);
 
   while (gegl_processor_work (processor, NULL)) ;
-  gegl_processor_destroy (processor);
+  g_object_unref (processor);
 }
 
 #else
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index f312ee9..c66e82a 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -799,17 +799,6 @@ gegl_processor_work (GeglProcessor *processor,
   return FALSE;
 }
 
-void
-gegl_processor_destroy (GeglProcessor *processor)
-{
-  /* The only thing this function is doing is shielding users of the
-   * library from GLib. If you are writing a language wrapper you can
-   * use the normal GObject unreffing mechanisms. This function will
-   * never do more than unreffing the processor.
-   */
-  g_object_unref (processor);
-}
-
 GeglProcessor *
 gegl_node_new_processor (GeglNode            *node,
                          const GeglRectangle *rectangle)
diff --git a/tests/simple/test-change-processor-rect.c b/tests/simple/test-change-processor-rect.c
index f0b2d91..1c11bb1 100644
--- a/tests/simple/test-change-processor-rect.c
+++ b/tests/simple/test-change-processor-rect.c
@@ -62,7 +62,7 @@ test_change_processor_rect_do_test (GeglProcessor       *processor,
                  "buffer", NULL,
                  NULL);
 
-  gegl_buffer_destroy (buffer);
+  g_object_unref (buffer);
 
   return result;
 }



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