diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-03-02 10:01:08 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:15:17 -0300 |
commit | 6423d561db86debe83247f2581b05d9e7f10a57e (patch) | |
tree | 29fa83adac3c4e57a1166eef9b96f548cf75dce2 /generator/cppgenerator.cpp | |
parent | d622c0f363c8d4c9bf91313aa3c8c0dc3e71424d (diff) |
Handles the situation properly when a custom code has a result value attribution.sb-1.0.0
If a method has a custom code that attributes a value to the Python
result variable, Shiboken should not generate code with attribution
to the said variable.
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r-- | generator/cppgenerator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index ea695280d..a8bb9ce18 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -2160,7 +2160,8 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f s << methodCall << ';' << endl; s << INDENT << "PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS" << endl; - if (!isCtor && !func->isInplaceOperator() && func->type()) { + if (!isCtor && !func->isInplaceOperator() && func->type() + && !injectedCodeHasReturnValueAttribution(func, TypeSystem::TargetLangCode)) { s << INDENT << PYTHON_RETURN_VAR " = "; writeToPythonConversion(s, func->type(), func->ownerClass(), CPP_RETURN_VAR); s << ';' << endl; |