Fixed bug with LastRefreshTimer
authorLaurent Bessard
Wed, 20 Feb 2013 19:35:48 +0100
changeset 933 6c320534627e
parent 932 ebe63100b6d7
child 934 fc00c11feff5
Fixed bug with LastRefreshTimer
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Wed Feb 20 01:18:08 2013 +0100
+++ b/graphics/GraphicCommons.py	Wed Feb 20 19:35:48 2013 +0100
@@ -409,16 +409,17 @@
                 self.LastRefreshTime = gettime()
                 self.Inhibit(True)
                 wx.CallAfter(self.RefreshViewOnNewData, *args, **kwargs)
+            else:
+                self.TimerAccessLock.acquire()
+                self.LastRefreshTimer = Timer(REFRESH_PERIOD, self.ShouldRefresh)
+                self.LastRefreshTimer.start()
+                self.TimerAccessLock.release()
         elif not self.IsShown() and self.HasAcquiredLock:
             DebugViewer.RefreshNewData(self)
             
     def RefreshViewOnNewData(self, *args, **kwargs):
         if self:
             self.RefreshNewData(*args, **kwargs)
-            self.TimerAccessLock.acquire()
-            self.LastRefreshTimer = Timer(REFRESH_PERIOD, self.ShouldRefresh)
-            self.LastRefreshTimer.start()
-            self.TimerAccessLock.release()
     
     def RefreshNewData(self, *args, **kwargs):
         self.Inhibit(False)