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 276c7ef

Browse filesBrowse files
committed
Avoid "wrapped C/C++ object has been deleted" when closing wx window.
A RuntimeError is otherwise triggered when closing a wx window by clicking the "x" button on the top right. Bisects to bce6263 which fixed another issue with wx...
1 parent 065769b commit 276c7ef
Copy full SHA for 276c7ef

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,9 @@ def show(self):
10581058
def destroy(self, *args):
10591059
# docstring inherited
10601060
_log.debug("%s - destroy()", type(self))
1061-
self.frame.Close()
1061+
frame = self.frame
1062+
if frame: # Else, may have been already deleted, e.g. when closing.
1063+
frame.Close()
10621064
wxapp = wx.GetApp()
10631065
if wxapp:
10641066
wxapp.Yield()

0 commit comments

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