Skip to content

Commit

Permalink
Merge pull request matplotlib#4426 from tacaswell/fix_pyqt_blit_fix
Browse files Browse the repository at this point in the history
FIX : hide ref counting violence unless needed
  • Loading branch information
mdboom committed Jun 10, 2015
2 parents 43d1f92 + 697c909 commit a951b75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .backend_qt5 import draw_if_interactive
from .backend_qt5 import backend_version
######

from .qt_compat import QT_API

DEBUG = False

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

pixmap = QtGui.QPixmap.fromImage(qImage)
p = QtGui.QPainter(self)
Expand Down

0 comments on commit a951b75

Please sign in to comment.