BeremizIDE.py
changeset 1795 e27d253bd0ba
parent 1792 4d1de8b0183f
child 1829 a776ac02b079
equal deleted inserted replaced
1794:e31d5a36d1f3 1795:e27d253bd0ba
   161             self.LastRefreshTimer = Timer(REFRESH_PERIOD, self._timer_expired)
   161             self.LastRefreshTimer = Timer(REFRESH_PERIOD, self._timer_expired)
   162             self.LastRefreshTimer.start()
   162             self.LastRefreshTimer.start()
   163             self.TimerAccessLock.release()
   163             self.TimerAccessLock.release()
   164 
   164 
   165     def _should_write(self):
   165     def _should_write(self):
   166         wx.CallAfter(self._write)
   166         app = wx.GetApp()
       
   167         if app is not None:
       
   168             wx.CallAfter(self._write)
       
   169 
   167         if MainThread == currentThread().ident:
   170         if MainThread == currentThread().ident:
   168             app = wx.GetApp()
       
   169             if app is not None:
   171             if app is not None:
   170                 if self.YieldLock.acquire(0):
   172                 if self.YieldLock.acquire(0):
   171                     app.Yield()
   173                     app.Yield()
   172                     self.YieldLock.release()
   174                     self.YieldLock.release()
   173 
   175