Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bec8457

Browse files
authored
Merge pull request #12097 from jklymak/auto-backport-of-pr-12092-on-v2.2.x
Backport PR #12092: Update backend_qt5agg to fix PySide2 mem issues
2 parents 139f05f + 1a9a555 commit bec8457

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def paintEvent(self, e):
6363
qimage = QtGui.QImage(buf, w, h, QtGui.QImage.Format_ARGB32)
6464
# Adjust the buf reference count to work around a memory leak bug
6565
# in QImage under PySide on Python 3.
66-
if QT_API == 'PySide' and six.PY3:
66+
if QT_API in ('PySide', 'PySide2') and six.PY3:
6767
ctypes.c_long.from_address(id(buf)).value = 1
6868
if hasattr(qimage, 'setDevicePixelRatio'):
6969
# Not available on Qt4 or some older Qt5.

0 commit comments

Comments
 (0)