summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generator/cppgenerator.cpp4
-rw-r--r--tests/samplebinding/modelview_test.py2
2 files changed, 2 insertions, 4 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 2b5a4584..8a922729 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -794,13 +794,11 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
s << (argMod.index - 1) << "));" << endl;
} else if (argMod.ownerships.contains(TypeSystem::NativeCode)) {
if (argMod.index == 0 && argMod.ownerships[TypeSystem::NativeCode] == TypeSystem::CppOwnership) {
- s << INDENT << "if (Shiboken::Object::checkType(" PYTHON_RETURN_VAR ")) {" << endl;
+ s << INDENT << "if (Shiboken::Object::checkType(" PYTHON_RETURN_VAR "))" << endl;
{
Indentation indent(INDENT);
s << INDENT << "Shiboken::Object::releaseOwnership(" PYTHON_RETURN_VAR ");" << endl;
- s << INDENT << "Py_DECREF((PyObject*) " PYTHON_RETURN_VAR ");" << endl;
}
- s << INDENT << '}' << endl;
}
}
}
diff --git a/tests/samplebinding/modelview_test.py b/tests/samplebinding/modelview_test.py
index 9f86166d..7b9bfe7b 100644
--- a/tests/samplebinding/modelview_test.py
+++ b/tests/samplebinding/modelview_test.py
@@ -57,7 +57,7 @@ class ModelViewTest(unittest.TestCase):
model = ListModelDoesntKeepsReference()
view = ObjectView(model)
obj = view.getRawModelData()
- self.assertEqual(type(obj), ObjectType)
+ self.assertEqual(type(obj), MyObject)
self.assertEqual(obj.objectName(), object_name)
def testListModelKeepsReference(self):