summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-03-23 18:21:45 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-03-25 11:32:54 -0300
commitf269b2a6af8134edbe1bfbc4d53e72ecbe61cdc6 (patch)
tree1ab7e2f2ce00e7054d373b07edd42f62e100aade
parent6eabc682fb8ffd9db9057740cf550989c1c25e4f (diff)
downloadshiboken-f269b2a6af8134edbe1bfbc4d53e72ecbe61cdc6.tar.gz
shiboken-f269b2a6af8134edbe1bfbc4d53e72ecbe61cdc6.tar.xz
shiboken-f269b2a6af8134edbe1bfbc4d53e72ecbe61cdc6.zip
Set object returned by getter function child of the property owner.
Doing this will invalidate the object then the property owner was deleted.
-rw-r--r--generator/cppgenerator.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index f2afba1d..c2a6476c 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2798,6 +2798,7 @@ void CppGenerator::writeGetterFunction(QTextStream& s, const AbstractMetaField*
if (useReference) {
s << "Shiboken::createWrapper(" << cppField << ");" << endl;
s << INDENT << "Shiboken::Object::releaseOwnership(val);" << endl;
+ s << INDENT << "Shiboken::Object::setParent(self, val);" << endl;
} else {
writeToPythonConversion(s, metaField->type(), metaField->enclosingClass(), cppField);
s << ';' << endl;