aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpysideqml/pysideqmlregistertype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/libpysideqml/pysideqmlregistertype.cpp')
-rw-r--r--sources/pyside6/libpysideqml/pysideqmlregistertype.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmlregistertype.cpp b/sources/pyside6/libpysideqml/pysideqmlregistertype.cpp
index cbacd5887..5f5d5fff8 100644
--- a/sources/pyside6/libpysideqml/pysideqmlregistertype.cpp
+++ b/sources/pyside6/libpysideqml/pysideqmlregistertype.cpp
@@ -59,20 +59,17 @@
#include <QtQml/QJSValue>
#include <QtQml/QQmlListProperty>
-// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
-static QMutex nextQmlElementMutex;
-
static PySide::Qml::QuickRegisterItemFunction quickRegisterItemFunction = nullptr;
static void createInto(void *memory, void *type)
{
- QMutexLocker locker(&nextQmlElementMutex);
+ QMutexLocker locker(&PySide::nextQObjectMemoryAddrMutex());
PySide::setNextQObjectMemoryAddr(memory);
Shiboken::GilState state;
PyObject *obj = PyObject_CallObject(reinterpret_cast<PyObject *>(type), 0);
if (!obj || PyErr_Occurred())
PyErr_Print();
- PySide::setNextQObjectMemoryAddr(0);
+ PySide::setNextQObjectMemoryAddr(nullptr);
}
PyTypeObject *qObjectType()