[gjs] gi: function: Support callbacks with (transfer full) return types



commit 348ee04116eb4681320251329551d6b1ba2794d4
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jun 2 17:09:02 2015 +0200

    gi: function: Support callbacks with (transfer full) return types
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750286

 gi/function.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gi/function.cpp b/gi/function.cpp
index 304dcdb..6a3b8c7 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -290,7 +290,9 @@ gjs_callback_closure(ffi_cif *cif,
 
     if (n_outargs == 0 && !ret_type_is_void) {
         GIArgument argument;
+        GITransfer transfer;
 
+        transfer = g_callable_info_get_caller_owns (trampoline->info);
         /* non-void return value, no out args. Should
          * be a single return value. */
         if (!gjs_value_to_g_argument(context,
@@ -298,7 +300,7 @@ gjs_callback_closure(ffi_cif *cif,
                                      &ret_type,
                                      "callback",
                                      GJS_ARGUMENT_RETURN_VALUE,
-                                     GI_TRANSFER_NOTHING,
+                                     transfer,
                                      TRUE,
                                      &argument))
             goto out;


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