summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-25 14:15:51 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-01-25 15:51:15 -0200
commitafe65270f1b28756172b72ba1d6af8f157a998bc (patch)
tree1ccecb99734f7df84923f9b369c5b0b2faac71bd
parent55daad72b2358614bd4ec69728887ba631f01a4c (diff)
downloadshiboken-afe65270f1b28756172b72ba1d6af8f157a998bc.tar.gz
shiboken-afe65270f1b28756172b72ba1d6af8f157a998bc.tar.xz
shiboken-afe65270f1b28756172b72ba1d6af8f157a998bc.zip
Fix bug#640 - "(elasticnode) Crash in example elasticnodes.py"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 1c5cd071..9b9c9108 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2751,6 +2751,7 @@ void CppGenerator::writeGetterFunction(QTextStream& s, const AbstractMetaField*
// Force use of pointer to return internal variable memory
bool useReference = (!metaType->isConstant() &&
!metaType->isEnum() &&
+ !metaType->isFlags() &&
!metaType->isPrimitive() &&
metaType->indirections() == 0);
@@ -2768,15 +2769,15 @@ void CppGenerator::writeGetterFunction(QTextStream& s, const AbstractMetaField*
.arg(metaField->name());
if (useReference) {
- s << INDENT << "Shiboken::createWrapper(" << cppField << ");" << endl;
+ s << "Shiboken::createWrapper(" << cppField << ");" << endl;
s << INDENT << "Shiboken::Object::releaseOwnership(val);" << endl;
} else {
writeToPythonConversion(s, metaField->type(), metaField->enclosingClass(), cppField);
s << ';' << endl;
}
- s << INDENT << "return val;" << endl
- << endl << '}' << endl;
+ s << INDENT << "return val;" << endl;
+ s << '}' << endl << endl;
}
void CppGenerator::writeSetterFunction(QTextStream& s, const AbstractMetaField* metaField)