Skip to content

Commit 963b667

Browse files
authored
Fix crash in GC: PyTuple_SET_ITEM steals reference
1 parent c07f09f commit 963b667

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PythonQt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, Py
763763
PyObject* className = PyString_FromString(enumName);
764764

765765
PyObject* baseClasses = PyTuple_New(1);
766+
Py_INCREF(&PyInt_Type);
766767
PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
767768

768769
PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
@@ -2439,4 +2440,4 @@ PythonQtClassInfo* PythonQtPrivate::getClassInfo( const QByteArray& className )
24392440
void PythonQtPrivate::registerLazyClass( const QByteArray& name, const QByteArray& moduleToImport )
24402441
{
24412442
_knownLazyClasses.insert(name, moduleToImport);
2442-
}
2443+
}

0 commit comments

Comments
 (0)