def on_exit(self): # if a handler is explicitly attaching at on_enter, it should detach # at on_exit, else two bad things happens: # The event dispatcher will continue calling the listener even if the # node is not in the active scene # The event dispatcher retains a reference to the registered function, # thus preventing garbage collection director.remove_handlers(self.on_cocos_resize) super(AutocenteredBackgroundLayer,self).on_exit() # we want auto center to hold even when added to an active scene, or # when the scene containing the layer is director.pushed and then popped, # so we do here a direct call to on_cocos_resize self.on_cocos_resize(director._usable_width, director._usable_height)
def on_exit(self): super(ParticleSystem, self).on_exit() director.remove_handlers(self)
def on_exit(self): """Called everytime the Particle system exits the stage.""" super(ParticleSystem, self).on_exit() director.remove_handlers(self)