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 85b68b7

Browse filesBrowse files
committed
Merge pull request #5639 from RobinD42/issue3316-fix-wx-crash
Test if a frame is not already being deleted before trying to Destroy.
2 parents 3ae7c2a + 187c5bc commit 85b68b7
Copy full SHA for 85b68b7

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.