Skip to content

Commit 545892a

Browse files
committed
Move all super().destroy() calls to the end
1 parent 5906a4f commit 545892a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ def _create_comm(self):
137137
return comm
138138

139139
def destroy(self):
140-
super().destroy()
141140
self._send_event('close')
142141
# need to copy comms as callbacks will modify this list
143142
for comm in list(self.web_sockets):
144143
comm.on_close()
145144
self.clearup_closed()
145+
super().destroy()
146146

147147
def clearup_closed(self):
148148
"""Clear up any closed Comms."""

lib/matplotlib/backends/backend_qt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ def show(self):
664664
self.window.raise_()
665665

666666
def destroy(self, *args):
667-
super().destroy()
668667
# check for qApp first, as PySide deletes it in its atexit handler
669668
if QtWidgets.QApplication.instance() is None:
670669
return
@@ -674,6 +673,7 @@ def destroy(self, *args):
674673
if self.toolbar:
675674
self.toolbar.destroy()
676675
self.window.close()
676+
super().destroy()
677677

678678
def get_window_title(self):
679679
return self.window.windowTitle()

lib/matplotlib/backends/backend_wx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,12 @@ def show(self):
10071007
def destroy(self, *args):
10081008
# docstring inherited
10091009
_log.debug("%s - destroy()", type(self))
1010-
super().destroy()
10111010
frame = self.frame
10121011
if frame: # Else, may have been already deleted, e.g. when closing.
10131012
# As this can be called from non-GUI thread from plt.close use
10141013
# wx.CallAfter to ensure thread safety.
10151014
wx.CallAfter(frame.Close)
1015+
super().destroy()
10161016

10171017
def full_screen_toggle(self):
10181018
# docstring inherited

0 commit comments

Comments
 (0)