[perl-Glib-Object-Introspection] Fix the user data marshalling for callbacks



commit 57e81d7e360dcc4c0fe21e5463ed971bd5646bfd
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sat Jun 4 23:19:46 2011 +0200

    Fix the user data marshalling for callbacks

 GObjectIntrospection.xs |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/GObjectIntrospection.xs b/GObjectIntrospection.xs
index 507c5fd..ea4b339 100644
--- a/GObjectIntrospection.xs
+++ b/GObjectIntrospection.xs
@@ -1733,6 +1733,14 @@ invoke_callback (ffi_cif* cif, gpointer resp, gpointer* args, gpointer userdata)
 		GITransfer transfer = g_arg_info_get_ownership_transfer (arg_info);
 		GIDirection direction = g_arg_info_get_direction (arg_info);
 
+		/* the closure argument, which we handle separately, is marked
+		 * by having get_closure == i */
+		if (g_arg_info_get_closure (arg_info) == i) {
+			g_base_info_unref ((GIBaseInfo *) arg_info);
+			g_base_info_unref ((GIBaseInfo *) arg_type);
+			continue;
+		}
+
 		dwarn ("arg info: %p\n"
 		       "  direction: %d\n"
 		       "  is return value: %d\n"



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