graphics/SFC_Objects.py
changeset 249 d8425712acef
parent 243 c5da8b706cde
child 253 d9391572655f
--- a/graphics/SFC_Objects.py	Fri Sep 05 18:12:23 2008 +0200
+++ b/graphics/SFC_Objects.py	Fri Sep 05 18:13:18 2008 +0200
@@ -59,11 +59,16 @@
         self.Output = None
         self.Action = None
     
-    # Destructor
-    def __del__(self):
-        self.Input = None
-        self.Output = None
-        self.Action = None
+    def Flush(self):
+        if self.Input is not None:
+            self.Input.Flush()
+            self.Input = None
+        if self.Output is not None:
+            self.Output.Flush()
+            self.Output = None
+        if self.Output is not None:
+            self.Action.Flush()
+            self.Action = None
     
     # Make a clone of this SFC_Step
     def Clone(self, parent, id = None, name = "Step", pos = None):
@@ -518,11 +523,15 @@
         self.SetPriority(priority)
         self.Errors = {}
     
-    # Destructor
-    def __del__(self):
-        self.Input = None
-        self.Output = None
-        if self.Type == "connection":
+    def Flush(self):
+        if self.Input is not None:
+            self.Input.Flush()
+            self.Input = None
+        if self.Output is not None:
+            self.Output.Flush()
+            self.Output = None
+        if self.Type == "connection" and self.Condition is not None:
+            self.Condition.Flush()
             self.Condition = None
     
     # Make a clone of this SFC_Transition
@@ -921,9 +930,12 @@
                 self.Inputs.append(Connector(self, "", None, wx.Point(i * SFC_DEFAULT_SEQUENCE_INTERVAL, 0), NORTH, onlyone = True))
             self.Outputs = [Connector(self, "", None, wx.Point(self.Size[0] / 2, self.Size[1]), SOUTH, onlyone = True)]
     
-    # Destructor
-    def __del__(self):
+    def Flush(self):
+        for input in self.Inputs:
+            input.Flush()
         self.Inputs = []
+        for output in self.Outputs:
+            output.Flush()
         self.Outputs = []
     
     # Make a clone of this SFC_Divergence
@@ -1338,9 +1350,10 @@
         # Create an input and output connector
         self.Input = Connector(self, "", None, wx.Point(self.Size[0] / 2, 0), NORTH, onlyone = True)
         
-    # Destructor
-    def __del__(self):
-        self.Input = None
+    def Flush(self):
+        if self.Input is not None:
+            self.Input.Flush()
+            self.Input = None
     
     # Make a clone of this SFC_Jump
     def Clone(self, parent, id = None, pos = None):
@@ -1564,9 +1577,10 @@
         self.Input = Connector(self, "", None, wx.Point(0, SFC_ACTION_MIN_SIZE[1] / 2), WEST, onlyone = True)
         self.SetActions(actions)
     
-    # Destructor
-    def __del__(self):
-        self.Input = None
+    def Flush(self):
+        if self.Input is not None:
+            self.Input.Flush()
+            self.Input = None
     
     # Make a clone of this SFC_ActionBlock
     def Clone(self, parent, id = None, pos = None):