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

Skip to content

Commit 5c5e638

Browse files
authored
Merge pull request #14294 from meeseeksmachine/auto-backport-of-pr-14282-on-v3.1.x
Backport PR #14282 on branch v3.1.x (Fix toolmanager's destroy subplots in tk)
2 parents 095830e + a703d87 commit 5c5e638

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/_backend_tk.py

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

914914
def destroy(self, *args, **kwargs):
915-
self.window.destroy()
916-
self.window = None
915+
if self.window is not None:
916+
self.window.destroy()
917+
self.window = None
917918

918919

919920
class HelpTk(backend_tools.ToolHelpBase):

0 commit comments

Comments
 (0)