summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-12-17 11:05:53 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-12-17 11:25:41 -0300
commit9459b9da9c85ec0f54d945ffa5b19174c285d9ac (patch)
tree2a14718180f351b006f20cd2150b3b7b43345697
parent81423ee9987008864cf1d66d009afc815c2419e5 (diff)
downloadshiboken-1.0.0-beta2.tar.gz
shiboken-1.0.0-beta2.tar.xz
shiboken-1.0.0-beta2.zip
Removed unnecessary code to check the refcount of Python objects returned on virtual methods.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 8a922729..2f116520 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;
}