summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-12-17 11:05:53 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:12:49 -0300
commit94270ee0e58336535378eef7fbb889c127f25c6b (patch)
tree7b7a609135fb9e56e5c96c8e67f0d8750684a54b
parent62d4437e2d0df7a0706b564519e8fb26303f1e9a (diff)
Removed unnecessary code to check the refcount of Python objects returned on virtual methods.sb-1.0.0-beta2
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index f1e900f3..ea304b93 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -810,20 +810,8 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
writeCodeSnips(s, snips, CodeSnip::End, TypeSystem::NativeCode, func, lastArg);
}
- if (type) {
- if (!invalidateReturn && (func->type()->isObject() || func->type()->isValuePointer()) ) {
- s << INDENT << "if (" << PYTHON_RETURN_VAR << "->ob_refcnt < 2) {" << endl;
- {
- Indentation indent(INDENT);
- s << INDENT << "PyErr_SetString(PyExc_ReferenceError, \"Returning last python reference on virtual function: "
- << func->ownerClass()->name() << "." << func->name() << "\");" << endl;
- s << INDENT << "PyErr_Print();" << endl;
- s << INDENT << "assert(false);" << endl;
- }
- s << INDENT << "}" << endl;
- }
+ if (type)
s << INDENT << "return " CPP_RETURN_VAR ";" << endl;
- }
s << '}' << endl << endl;
}