Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 187c5bc

Browse filesBrowse files
committed
Test if a frame is not already being deleted before trying to Destroy.
fixes #3316
1 parent 3ae7c2a commit 187c5bc
Copy full SHA for 187c5bc

File tree

Expand file treeCollapse file tree

1 file changed

+7
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-6
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,12 +1329,13 @@ def Destroy(self, *args, **kwargs):
13291329
# Rationale for line above: see issue 2941338.
13301330
except AttributeError:
13311331
pass # classic toolbar lacks the attribute
1332-
wx.Frame.Destroy(self, *args, **kwargs)
1333-
if self.toolbar is not None:
1334-
self.toolbar.Destroy()
1335-
wxapp = wx.GetApp()
1336-
if wxapp:
1337-
wxapp.Yield()
1332+
if not self.IsBeingDeleted():
1333+
wx.Frame.Destroy(self, *args, **kwargs)
1334+
if self.toolbar is not None:
1335+
self.toolbar.Destroy()
1336+
wxapp = wx.GetApp()
1337+
if wxapp:
1338+
wxapp.Yield()
13381339
return True
13391340

13401341

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.