Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d92440

Browse files
authored
Merge pull request #14282 from ImportanceOfBeingErnest/fix-toolmngr-destroy-subplots
Fix toolmanager's destroy subplots in tk
2 parents 4edadf9 + 83740b4 commit 7d92440

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/matplotlib/backends/_backend_tk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,9 @@ def init_window(self):
844844
self.window.protocol("WM_DELETE_WINDOW", self.destroy)
845845

846846
def destroy(self, *args, **kwargs):
847-
self.window.destroy()
848-
self.window = None
847+
if self.window is not None:
848+
self.window.destroy()
849+
self.window = None
849850

850851

851852
class HelpTk(backend_tools.ToolHelpBase):

0 commit comments

Comments
 (0)