diff options
Diffstat (limited to 'sources/pyside2/PySide2/templates')
-rw-r--r-- | sources/pyside2/PySide2/templates/gui_common.xml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/templates/gui_common.xml b/sources/pyside2/PySide2/templates/gui_common.xml index 16116877f..1a7406799 100644 --- a/sources/pyside2/PySide2/templates/gui_common.xml +++ b/sources/pyside2/PySide2/templates/gui_common.xml @@ -80,8 +80,9 @@ </template> <template name="qimage_buffer_constructor"> - auto *ptr = reinterpret_cast<uchar *>(Shiboken::Buffer::copyData(%PYARG_1)); - %0 = new %TYPE(ptr, %ARGS, std::free); + Py_INCREF(%PYARG_1); + auto ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1)); + %0 = new %TYPE(ptr, %ARGS, imageDecrefDataHandler, %PYARG_1); </template> <template name="qcolor_repr"> |