aboutsummaryrefslogtreecommitdiffstats
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>2012-03-08 16:15:18 -0300
commit3034659e09923a9417e244d5c3c656da30813373 (patch)
tree1b86c46d59df71ba48a1e443861ce29318fca4d7
parenta12f4499d7c3d762abde50ec46ca7665426e597a (diff)
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 f2afba1d8..c2a6476c4 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;