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

Skip to content

Commit a703d87

Browse files
timhoffmMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #14282: Fix toolmanager's destroy subplots in tk
1 parent 095830e commit a703d87

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)