parameters: (self)
docstring: Call this function to destroy the ShowBase and stop all
          its tasks, freeing all of the Panda resources.  Normally, you
          should not need to call it explicitly, as it is bound to the
          exitfunc and will be called at application exit time
          automatically.
  
          This function is designed to be safe to call multiple times.
docstring_summary: Call this function to destroy the ShowBase and stop all
          its tasks, freeing all of the Panda resources.  Normally, you
          should not need to call it explicitly, as it is bound to the
          exitfunc and will be called at application exit time
          automatically.
docstring_tokens: Call this function to destroy the ShowBase and stop all its tasks freeing all of the Panda resources . Normally you should not need to call it explicitly as it is bound to the exitfunc and will be called at application exit time automatically .
function: def destroy(self):
          """ Call this function to destroy the ShowBase and stop all
          its tasks, freeing all of the Panda resources.  Normally, you
          should not need to call it explicitly, as it is bound to the
          exitfunc and will be called at application exit time
          automatically.
  
          This function is designed to be safe to call multiple times."""
  
          for cb in self.finalExitCallbacks[:]:
              cb()
  
          # Remove the built-in base reference
          if getattr(builtins, 'base', None) is self:
              del builtins.run
              del builtins.base
              del builtins.loader
              del builtins.taskMgr
              ShowBaseGlobal = sys.modules.get('direct.showbase.ShowBaseGlobal', None)
              if ShowBaseGlobal:
                  del ShowBaseGlobal.base
  
          self.aspect2d.node().removeAllChildren()
          self.render2d.node().removeAllChildren()
          self.aspect2d.reparent_to(self.render2d)
  
          # [gjeon] restore sticky key settings
          if self.__disabledStickyKeys:
              allowAccessibilityShortcutKeys(True)
              self.__disabledStickyKeys = False
  
          self.ignoreAll()
          self.shutdown()
  
          if getattr(self, 'musicManager', None):
              self.musicManager.shutdown()
              self.musicManager = None
              for sfxManager in self.sfxManagerList:
                  sfxManager.shutdown()
              self.sfxManagerList = []
          if getattr(self, 'loader', None):
              self.loader.destroy()
              self.loader = None
          if getattr(self, 'graphicsEngine', None):
              self.graphicsEngine.removeAllWindows()
  
          try:
              self.direct.panel.destroy()
          except:
              pass
  
          if hasattr(self, 'win'):
              del self.win
              del self.winList
              del self.pipe
function_tokens: def destroy ( self ) : for cb in self . finalExitCallbacks [ : ] : cb ( ) # Remove the built-in base reference if getattr ( builtins , 'base' , None ) is self : del builtins . run del builtins . base del builtins . loader del builtins . taskMgr ShowBaseGlobal = sys . modules . get ( 'direct.showbase.ShowBaseGlobal' , None ) if ShowBaseGlobal : del ShowBaseGlobal . base self . aspect2d . node ( ) . removeAllChildren ( ) self . render2d . node ( ) . removeAllChildren ( ) self . aspect2d . reparent_to ( self . render2d ) # [gjeon] restore sticky key settings if self . __disabledStickyKeys : allowAccessibilityShortcutKeys ( True ) self . __disabledStickyKeys = False self . ignoreAll ( ) self . shutdown ( ) if getattr ( self , 'musicManager' , None ) : self . musicManager . shutdown ( ) self . musicManager = None for sfxManager in self . sfxManagerList : sfxManager . shutdown ( ) self . sfxManagerList = [ ] if getattr ( self , 'loader' , None ) : self . loader . destroy ( ) self . loader = None if getattr ( self , 'graphicsEngine' , None ) : self . graphicsEngine . removeAllWindows ( ) try : self . direct . panel . destroy ( ) except : pass if hasattr ( self , 'win' ) : del self . win del self . winList del self . pipe