aboutsummaryrefslogtreecommitdiffstats
path: root/tests/minimalbinding
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-10-21 14:11:58 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:31 -0300
commitdc022d65ce87882fdf6add900038e957f399453b (patch)
treedc5e9ec973ab7f1eccdaed0b475c37770a0ef976 /tests/minimalbinding
parent4a05efa3768e572c72aea594506ca7ddd5639712 (diff)
Fix crash in PySequence converters.
Diffstat (limited to 'tests/minimalbinding')
-rw-r--r--tests/minimalbinding/typesystem_minimal.xml5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/minimalbinding/typesystem_minimal.xml b/tests/minimalbinding/typesystem_minimal.xml
index cd26b34c2..7f1523b73 100644
--- a/tests/minimalbinding/typesystem_minimal.xml
+++ b/tests/minimalbinding/typesystem_minimal.xml
@@ -31,8 +31,9 @@
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
- for (int i = 0; i &lt; PySequence_Fast_GET_SIZE(%in); i++) {
- PyObject* pyItem = PySequence_Fast_GET_ITEM(%in, i);
+ Shiboken::AutoDecRef seq(PySequence_Fast(%in, 0));
+ for (int i = 0; i &lt; PySequence_Fast_GET_SIZE(seq.object()); i++) {
+ PyObject* pyItem = PySequence_Fast_GET_ITEM(seq.object(), i);
%OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
%out.push_back(cppItem);
}