File tree 1 file changed +5
-1
lines changed 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def paintEvent(self, e):
75
75
# FigureCanvasQT.paintEvent(self, e)
76
76
if DEBUG :
77
77
print ('FigureCanvasQtAgg.paintEvent: ' , self ,
78
- self .get_width_height ())
78
+ self .get_width_height ())
79
79
80
80
if self .blitbox is None :
81
81
# matplotlib is in rgba byte order. QImage wants to put the bytes
@@ -125,6 +125,10 @@ def paintEvent(self, e):
125
125
stringBuffer = reg .to_string_argb ()
126
126
qImage = QtGui .QImage (stringBuffer , w , h ,
127
127
QtGui .QImage .Format_ARGB32 )
128
+ # Adjust the stringBuffer reference count to work around a memory
129
+ # leak bug in QImage() under PySide on Python 3.x
130
+ ctypes .c_long .from_address (id (stringBuffer )).value = 1
131
+
128
132
pixmap = QtGui .QPixmap .fromImage (qImage )
129
133
p = QtGui .QPainter (self )
130
134
p .drawPixmap (QtCore .QPoint (l , self .renderer .height - t ), pixmap )
You can’t perform that action at this time.
0 commit comments