forgot to add patch

This commit is contained in:
Daniel Drake 2012-12-21 10:27:24 +00:00
parent 4f84db6ac5
commit ff088ad3ed

30
structarray.patch Normal file
View File

@ -0,0 +1,30 @@
From 9454c01f2b1b82d43eea0f72fe9a28ef50065fc9 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlos@lanedo.com>
Date: Tue, 18 Dec 2012 21:47:09 +0000
Subject: Fix marshalling of arrays of boxed struct values
This fixes methods like gtk_selection_set_with_data(). In such cases
data is passed as an array of struct pointers, so it must be converted
to an array of structs.
https://bugzilla.gnome.org/show_bug.cgi?id=656312
Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
---
diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c
index dc14ca5..e842227 100644
--- a/gi/pygi-marshal-from-py.c
+++ b/gi/pygi-marshal-from-py.c
@@ -1009,6 +1009,12 @@ _pygi_marshal_from_py_array (PyGIInvokeState *state,
if (from_py_cleanup)
from_py_cleanup (state, item_arg_cache, item.v_pointer, TRUE);
}
+ } else if (is_boxed && !item_iface_cache->arg_cache.is_pointer) {
+ /* The array elements are not expected to be pointers, but the
+ * elements obtained are boxed pointers themselves, so insert
+ * the pointed to data.
+ */
+ g_array_insert_vals (array_, i, item.v_pointer, 1);
} else {
g_array_insert_val (array_, i, item);
}