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

Skip to content

Commit 0bd9367

Browse files
Track ownership of mainloop with class attribute Part II: GREEN
1 parent d7e6799 commit 0bd9367

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/backends/_backend_tk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class FigureManagerTk(FigureManagerBase):
398398
The tk.Window
399399
"""
400400

401-
#_owns_mainloop = False
401+
_owns_mainloop = False
402402

403403
def __init__(self, canvas, num, window):
404404
FigureManagerBase.__init__(self, canvas, num)
@@ -462,7 +462,7 @@ def destroy(self, *args):
462462
self.canvas._tkcanvas.after_cancel(self.canvas._idle_callback)
463463
self.window.destroy()
464464
if Gcf.get_num_fig_managers() == 0:
465-
if self.window is not None:# and self._owns_mainloop:
465+
if self.window is not None and self._owns_mainloop:
466466
self.window.quit()
467467
self.window = None
468468

@@ -885,6 +885,6 @@ def trigger_manager_draw(manager):
885885
def mainloop(cls):
886886
managers = Gcf.get_all_fig_managers()
887887
if managers:
888-
#cls._owns_mainloop = True
888+
cls._owns_mainloop = True
889889
managers[0].window.mainloop()
890-
#cls._owns_mainloop = False
890+
cls._owns_mainloop = False

0 commit comments

Comments
 (0)