aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generator/cppgenerator.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index f1e900f36..ea304b937 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;
}