App: Fix segmentation fault while dragging object

For more details see: https://forum.freecad.org/viewtopic.php?t=86001

The reason of the crash is that the GIL is not locked while accessing certain Python functions
This commit is contained in:
wmayer
2024-03-11 07:59:25 +01:00
committed by wwmayer
parent 819e99e334
commit f0881b5dbf

View File

@@ -147,6 +147,7 @@ public:
//override the documentobjectextension functions to make them available in python
bool allowObject(DocumentObject* obj) override {
Base::PyGILStateLocker locker;
Py::Object pyobj = Py::asObject(obj->getPyObject());
EXTENSION_PROXY_ONEARG(allowObject, pyobj);