aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/basewrapper.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-03-24 20:30:01 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-03-30 11:41:59 -0300
commit42276efa04d94d79b0b98d070550e95f67870ae3 (patch)
tree0c069423a572e9088fbd8b9d9f87e2aeaddc5155 /libshiboken/basewrapper.cpp
parent306a4e241ad54ccb96e85e4d5bd532eff83a8a1f (diff)
Fix setParent function when the child is a sequence object.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
Diffstat (limited to 'libshiboken/basewrapper.cpp')
-rw-r--r--libshiboken/basewrapper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index d2c541011..f780db3ca 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -60,8 +60,9 @@ void setParent(PyObject* parent, PyObject* child)
//Recursive for sequence protocol
if (PySequence_Check(child)) {
- for (int i = 0, max = PySequence_Size(child); i < max; ++i)
- setParent(parent, PySequence_Fast_GET_ITEM(child, i));
+ Shiboken::AutoDecRef seq(PySequence_Fast(child, 0));
+ for (int i = 0, max = PySequence_Size(seq); i < max; ++i)
+ setParent(parent, PySequence_Fast_GET_ITEM(seq.object(), i));
return;
}