Sfoglia il codice sorgente

wxGUI: fix aborting render threads

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65328 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 anni fa
parent
commit
46c7d81d86
2 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. 2 2
      gui/wxpython/core/gthread.py
  2. 5 1
      gui/wxpython/core/render.py

+ 2 - 2
gui/wxpython/core/gthread.py

@@ -115,6 +115,6 @@ class gThread(threading.Thread, wx.EvtHandler):
         if event.ondone:
         if event.ondone:
             event.ondone(event)
             event.ondone(event)
 
 
-    def Terminate(self):
+    def Terminate(self, terminate=True):
         """Abort command(s)"""
         """Abort command(s)"""
-        self.terminate = True
+        self.terminate = terminate

+ 5 - 1
gui/wxpython/core/render.py

@@ -388,7 +388,11 @@ class RenderLayerMgr(wx.EvtHandler):
         """Abort rendering process"""
         """Abort rendering process"""
         Debug.msg(1, "RenderLayerMgr({}).Abort()".format(self.layer))
         Debug.msg(1, "RenderLayerMgr({}).Abort()".format(self.layer))
         self.thread.Terminate()
         self.thread.Terminate()
-
+        
+        # force rendering layer next time
+        self.layer.forceRender = True
+        self.thread.Terminate(False)
+        
     def IsDownloading(self):
     def IsDownloading(self):
         """Is downloading
         """Is downloading