aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-03-02 10:01:08 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:17 -0300
commit6423d561db86debe83247f2581b05d9e7f10a57e (patch)
tree29fa83adac3c4e57a1166eef9b96f548cf75dce2
parentd622c0f363c8d4c9bf91313aa3c8c0dc3e71424d (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>
-rw-r--r--generator/cppgenerator.cpp3
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;