1. artgins
  2. ginsfsm

Commits

Ginés Martínez Sánchez  committed 8a106df Draft

convert destroy_gobj() in static method

  • Participants
  • Parent commits e9f5e08
  • Branches default

Comments (0)

Files changed (2)

File ginsfsm/gaplic.py

View file
  • Ignore whitespace
                         ''' cannot _register_unique_gobj '%s' ''' % (name))
         return gobj
 
-    def destroy_gobj(self, gobj):
+    @staticmethod
+    def destroy_gobj(gobj):
         """ Destroy a gobj
         """
-        if self.__unique_name__:
-            self._deregister_unique_gobj(gobj)
-        GObj.destroy_gobj(self, gobj)
+        if gobj.__unique_name__:
+            gobj.gaplic._deregister_unique_gobj(gobj)
+        GObj.destroy_gobj(gobj)
 
     def subscribe_external_event(self, gobj, event_name, subscriber_gobj, **kw):
         """ Subscribe to event of an external gaplic.

File ginsfsm/gobj.py

View file
  • Ignore whitespace
         else:
             return '%d' % (_urandom_name)
 
-    def destroy_gobj(self, gobj):
+    @staticmethod
+    def destroy_gobj(gobj):
         """ Destroy a gobj
         """
         if gobj.parent is not None:
         while len(gobj.dl_childs):
             try:
                 for child in gobj.dl_childs:
-                    self.destroy_gobj(child)
+                    GObj.destroy_gobj(child)
             except RuntimeError:
                 pass  # "Set changed size during iteration" is OK