Fix bug debug slow interface when refresh time of a DebugViewer is longer than debug refresh period
authorLaurent Bessard
Wed, 16 Jan 2013 22:41:38 +0100
changeset 904 73f6333d50a4
parent 903 e70daa8bca85
child 905 eaa1d3a4b52b
Fix bug debug slow interface when refresh time of a DebugViewer is longer than debug refresh period
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Wed Jan 16 22:35:06 2013 +0100
+++ b/graphics/GraphicCommons.py	Wed Jan 16 22:41:38 2013 +0100
@@ -402,8 +402,7 @@
             self.LastRefreshTimer=None
         self.TimerAccessLock.release()
         if self.IsShown() and not self.Inhibited:
-            current_time = gettime()
-            if current_time - self.LastRefreshTime > REFRESH_PERIOD and DEBUG_REFRESH_LOCK.acquire(False):
+            if gettime() - self.LastRefreshTime > REFRESH_PERIOD and DEBUG_REFRESH_LOCK.acquire(False):
                 self.AccessLock.acquire()
                 self.HasAcquiredLock = True
                 self.AccessLock.release()
@@ -427,6 +426,8 @@
         if self.HasAcquiredLock:
             DEBUG_REFRESH_LOCK.release()
             self.HasAcquiredLock = False
+        if gettime() - self.LastRefreshTime > REFRESH_PERIOD:
+            self.LastRefreshTime = gettime()
         self.AccessLock.release()
 
 #-------------------------------------------------------------------------------