diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-03-22 10:55:13 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:15:18 -0300 |
commit | 0882f35b2d010515593ee3ddfe64e94f7f9942e5 (patch) | |
tree | 8aff61aadbe2eb6a8b34f20c39afcadff733fc31 /generator | |
parent | 17546cd6200fd45d57e8b07b77f2f99ade36776b (diff) |
Updated module reload test.
Avoid to load a module twice.
Fixes bug #734.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 77f156836..a6d810158 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -3418,6 +3418,7 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m s << INDENT << "Shiboken::ObjectType::setDestructorFunction(&" << cpythonTypeName(metaClass) << ", &Shiboken::callCppDestructor<" << dtorClassName << " >);" << endl; } + s << INDENT << "Py_INCREF((PyObject*)&" << pyTypeName << "); //Incref due the 'PyModule_AddObject' steals the reference." << endl; s << INDENT << "if (PyType_Ready((PyTypeObject*)&" << pyTypeName << ") < 0)" << endl; s << INDENT << INDENT << "return;" << endl << endl; |