Bug when plcopeneditor without Beremiz fixed
authorgreg
Wed, 03 Jun 2009 09:38:23 +0200
changeset 364 deee68313770
parent 363 5eb9c5536334
child 365 7bfd014652e0
Bug when plcopeneditor without Beremiz fixed
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Tue Jun 02 17:35:22 2009 +0200
+++ b/graphics/GraphicCommons.py	Wed Jun 03 09:38:23 2009 +0200
@@ -230,14 +230,15 @@
         
         self.LastRefreshTime = time.time()
         
-        if register_tick:
+        if register_tick and debug:
             self.DataProducer.SubscribeDebugIECVariable("__tick__", self)
         
         self.RefreshTimer = wx.Timer(self, -1)
         self.Bind(wx.EVT_TIMER, self.OnRefreshTimer, self.RefreshTimer)
     
     def __del__(self):
-        self.DataProducer.UnsubscribeDebugIECVariable("__tick__", self)
+        if self.Debug:
+            self.DataProducer.UnsubscribeDebugIECVariable("__tick__", self)
         self.DeleteDataConsumers()
         self.RefreshTimer.Stop()