浏览代码

wxGUI/animation: fix closing window when animation is running (merged from trunk, https://trac.osgeo.org/grass/changeset/59517)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@59518 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 年之前
父节点
当前提交
f806f11f7a
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      gui/wxpython/animation/frame.py

+ 3 - 0
gui/wxpython/animation/frame.py

@@ -309,10 +309,13 @@ class AnimationFrame(wx.Frame):
                    entry='wxGUI.animation')
 
     def OnCloseWindow(self, event):
+        if self.controller.timer.IsRunning():
+                self.controller.timer.Stop()
         CleanUp(TMP_DIR)()
         self.Destroy()
 
     def __del__(self):
+        """!It might not be called, therefore we try to clean it all in OnCloseWindow."""
         if hasattr(self, 'controller') and hasattr(self.controller, 'timer'):
             if self.controller.timer.IsRunning():
                 self.controller.timer.Stop()