summaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/cppgenerator.cpp')
-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)