Пример #1
0
    def part(self):
        """
        Called when the actor is about to be removed from the world.
        """
        #print "Parting ", self.__class__
        self.__state__ = self.STATE_PARTING
        sm = self.mCont.getSceneManager()
        if hasattr(self, 'thread'):
            #print "removeing thread"
            mthread.kill(self.thread())
            #del self.thread
        if hasattr(self, 'body'):
            #print "removeing body"
            self.body.setListener(None)
            CPhysicsEnv.unregisterRigidBody(self.body)
            #import gc
            #print gc.get_referrers(self.body)
            self.body.self = None
            del self.body
        if hasattr(self, 'node'):
            #print "removeing node"
            sm.getRootSceneNode().removeChild(self.node)
            del self.node

        for id, thread in self.threads.items():
            mthread.kill(thread)
Пример #2
0
    def part(self):
        """
        Called when the actor is about to be removed from the world.
        """
        #print "Parting ", self.__class__
        self.__state__ = self.STATE_PARTING
        sm = self.mCont.getSceneManager()
        if hasattr(self, 'thread'):
            #print "removeing thread"
            mthread.kill(self.thread())
            #del self.thread
        if hasattr(self, 'body'):
            #print "removeing body"
            self.body.setListener(None)
            CPhysicsEnv.unregisterRigidBody(self.body)
            #import gc
            #print gc.get_referrers(self.body)
            self.body.self = None
            del self.body
        if hasattr(self, 'node'):
            #print "removeing node"
            sm.getRootSceneNode().removeChild(self.node)
            del self.node

        for id, thread in self.threads.items():
            mthread.kill(thread)
Пример #3
0
 def killSignalThreads(self, signame):
     thlist = actionPrefix + signame + '_threads'
     if not hasattr(self, thlist):
         return
     thlist = getattr(self, thlist)
     for id, thread in thlist.items():
         if mthread.isCurrent(thread):
             print "Killin self"
         try:
             mthread.kill(thread)
         except RuntimeError:
             pass
Пример #4
0
 def killSignalThreads(self, signame):
     thlist = actionPrefix + signame + '_threads'
     if not hasattr(self, thlist):
         return
     thlist = getattr(self, thlist)
     for id, thread in thlist.items():
         if mthread.isCurrent(thread):
             print "Killin self"
         try:
             mthread.kill(thread)
         except RuntimeError:
             pass