diff options
author | John Ehresman <jpe@wingware.com> | 2012-12-11 17:29:43 -0500 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-12-17 15:11:31 +0100 |
commit | 48259be8b3dc5f0c7b5026cc2821545b422d2c4f (patch) | |
tree | 365e1e281b14e64bb33bc865ce91e5bf478122c9 | |
parent | 46fe1eac50b094a6252e7a6a678a438f1b2c8f9a (diff) |
Use parent class's metaObject if wrapper is NULL.
Return metaObject from parent class if wrapper has been
invalidated, which currently happens in the *Wrapper class
destructor.
Change-Id: I1d5ef8802acf796cced7838b3ecc76f51201d906
Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
-rw-r--r-- | generator/shiboken/cppgenerator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/shiboken/cppgenerator.cpp b/generator/shiboken/cppgenerator.cpp index 562a1f0..2643ac7 100644 --- a/generator/shiboken/cppgenerator.cpp +++ b/generator/shiboken/cppgenerator.cpp @@ -820,6 +820,8 @@ void CppGenerator::writeMetaObjectMethod(QTextStream& s, const AbstractMetaClass s << INDENT << "if (QObject::d_ptr->metaObject) return QObject::d_ptr->metaObject;" << endl; s << INDENT << "#endif" << endl; s << INDENT << "SbkObject* pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);" << endl; + s << INDENT << "if (pySelf == NULL)" << endl; + s << INDENT << INDENT << "return " << metaClass->qualifiedCppName() << "::metaObject();" << endl; s << INDENT << "return PySide::SignalManager::retriveMetaObject(reinterpret_cast<PyObject*>(pySelf));" << endl; s << '}' << endl << endl; |