Skip to content

Commit f67ea3c

Browse files
committed
FIX: mro issue with pyside/pyqt4
Do not let a `super` be called or the the c++ base-classes will be initialized twice which causes havoc. - pyside failed on figure creation - pyqt4 may segfault on exit closes #5196
1 parent 84aa9f7 commit f67ea3c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/backends/backend_qt4agg.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from matplotlib.figure import Figure
1616

1717

18-
from .backend_qt5agg import FigureCanvasQTAggBase
18+
from .backend_qt5agg import FigureCanvasQTAggBase as _FigureCanvasQTAggBase
1919

2020
from .backend_agg import FigureCanvasAgg
2121
from .backend_qt4 import QtCore
@@ -54,6 +54,11 @@ def new_figure_manager_given_figure(num, figure):
5454
return FigureManagerQT(canvas, num)
5555

5656

57+
class FigureCanvasQTAggBase(_FigureCanvasQTAggBase):
58+
def __init__(self, figure):
59+
self._agg_draw_pending = False
60+
61+
5762
class FigureCanvasQTAgg(FigureCanvasQTAggBase,
5863
FigureCanvasQT, FigureCanvasAgg):
5964
"""

0 commit comments

Comments
 (0)