aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue/qtgui.cpp
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:19:15 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:19:15 +0300
commitd8f02ce77a4143aa4e7e6c4f7892e6a943c46b3c (patch)
treeeb92573ddeb44c25697f2d883d243a89c0d98b68 /sources/pyside2/PySide2/glue/qtgui.cpp
parentca0519cb3f6b62e3b61ba74f0c60eac891dd3a15 (diff)
parentbd4180ffdd47d423b0bd2b995b09df474b8c5a81 (diff)
Merge tag 'v5.15.5-lts' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Qt For Python Release 5.15.5 Change-Id: Id8648afb982e4f1354257a0b523bc9c6f1acce2a
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtgui.cpp')
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
index 1c74c73d2..00d045787 100644
--- a/sources/pyside2/PySide2/glue/qtgui.cpp
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -190,6 +190,16 @@ for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){
%0 = new %TYPE(QPixmap::fromImage(%1));
// @snippet qpixmap
+// @snippet qimage-decref-image-data
+static void imageDecrefDataHandler(void *data)
+{
+ // Avoid "Python memory allocator called without holding the GIL"
+ auto state = PyGILState_Ensure();
+ Py_DECREF(reinterpret_cast<PyObject *>(data));
+ PyGILState_Release(state);
+}
+// @snippet qimage-decref-image-data
+
// @snippet qimage-constbits
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
// @snippet qimage-constbits