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

Skip to content

Commit a951b75

Browse files
committed
Merge pull request #4426 from tacaswell/fix_pyqt_blit_fix
FIX : hide ref counting violence unless needed
2 parents 43d1f92 + 697c909 commit a951b75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .backend_qt5 import draw_if_interactive
2424
from .backend_qt5 import backend_version
2525
######
26-
26+
from .qt_compat import QT_API
2727

2828
DEBUG = False
2929

@@ -127,7 +127,8 @@ def paintEvent(self, e):
127127
QtGui.QImage.Format_ARGB32)
128128
# Adjust the stringBuffer reference count to work around a memory
129129
# leak bug in QImage() under PySide on Python 3.x
130-
ctypes.c_long.from_address(id(stringBuffer)).value = 1
130+
if QT_API == 'PySide' and six.PY3:
131+
ctypes.c_long.from_address(id(stringBuffer)).value = 1
131132

132133
pixmap = QtGui.QPixmap.fromImage(qImage)
133134
p = QtGui.QPainter(self)

0 commit comments

Comments
 (0)