aboutsummaryrefslogtreecommitdiffstats
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>2012-03-08 16:12:55 -0300
commit47adfdb74f710f3756279c7c55fcacdbfa95a199 (patch)
tree35d88a339fce222d3fc3840c2c5410ab77d4f3ab
parent70a863eb2da935505ffa325c1772b13f4a80bded (diff)
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 3eed2ffbc..220975e18 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2753,6 +2753,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);
@@ -2770,15 +2771,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)