Fix bug#552 - "Segmentation fault when using QUiLoader and QTabWidget"
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
e9d1dc38e2
commit
4a2bfc9239
5 changed files with 68 additions and 3 deletions
|
|
@ -112,8 +112,10 @@ static void destructionVisitor(SbkObject* pyObj, void* data)
|
|||
PyTypeObject* pyQObjectType = reinterpret_cast<PyTypeObject*>(realData[1]);
|
||||
|
||||
if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {
|
||||
if (Shiboken::Object::hasOwnership(pyObj))
|
||||
Shiboken::callCppDestructor<QObject>(Shiboken::Object::cppPointer(pyObj, Shiboken::SbkType<QObject*>()));
|
||||
if (Shiboken::Object::hasOwnership(pyObj) && Shiboken::Object::isValid(pyObj, false)) {
|
||||
Shiboken::callCppDestructor<QObject>(Shiboken::Object::cppPointer(pyObj, pyQObjectType));
|
||||
Shiboken::Object::setValidCpp(pyObj, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue