Skip to content

Commit ab5ad66

Browse files
committed
reuse wrapper if it inherits, not only if it is the same class
1 parent bac28f6 commit ab5ad66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PythonQt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name, bool passO
596596
info->setMetaObject(wrapper->metaObject());
597597
}
598598

599-
if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo() == info) {
599+
if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo()->inherits(info)) {
600600
wrap = possibleStillAliveWrapper;
601601
Py_INCREF(wrap);
602602
} else {

0 commit comments

Comments
 (0)