BeremizIDE.py
changeset 1795 e27d253bd0ba
parent 1792 4d1de8b0183f
child 1829 a776ac02b079
--- a/BeremizIDE.py	Mon Aug 28 10:49:53 2017 +0000
+++ b/BeremizIDE.py	Fri Sep 08 11:53:48 2017 +0300
@@ -163,9 +163,11 @@
             self.TimerAccessLock.release()
 
     def _should_write(self):
-        wx.CallAfter(self._write)
+        app = wx.GetApp()
+        if app is not None:
+            wx.CallAfter(self._write)
+
         if MainThread == currentThread().ident:
-            app = wx.GetApp()
             if app is not None:
                 if self.YieldLock.acquire(0):
                     app.Yield()