[gegl-gtk] Correct gegl_gtk_view_set_node’s transfer from full to none



commit dd7c451f943aeff0c85208826b1302d4cc58ae47
Author: jordi fita i mas <gmf trasto cat>
Date:   Sat Feb 1 18:02:34 2014 +0100

    Correct gegl_gtk_view_set_node’s transfer from full to none
    
    The transfer of this function should be none because the helper’s
    increases the node’s reference counter meaning that the caller still has
    to unref it afterwards.
    
    This caused a memory leak in the Vala example because
    Gegl.Node.create_child returns an "unowned" node (i.e. the caller
    doesn’t need to call unref) but Vala had to call ref on this node before
    calling GeglGtk.View.set_node but didn’t call unref, as is the case when
    passing an unowned variable to a full transfer function.  Thus, ref was
    called twice (once by Vala and the other by the helper) but unref only
    once (by the helper), creating the leak.
    
        *  gegl-gtk/gegl-gtk-view.c (gegl_gtk_view_set_node): Change
           transfer annotation from full to none.

 gegl-gtk/gegl-gtk-view.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gegl-gtk/gegl-gtk-view.c b/gegl-gtk/gegl-gtk-view.c
index c9fa8bc..5d55aa6 100644
--- a/gegl-gtk/gegl-gtk-view.c
+++ b/gegl-gtk/gegl-gtk-view.c
@@ -489,7 +489,7 @@ gegl_gtk_view_new_for_node(GeglNode *node)
 /**
  * gegl_gtk_view_set_node:
  * @self: A #GeglGtkView
- * @node: (transfer full)(allow-none): a #GeglNode instance or %NULL
+ * @node: (transfer none)(allow-none): a #GeglNode instance or %NULL
  *
  * Change the #GeglNode to display
  **/


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