code: def _delete(self, ):
          
          for k in self.keys():
              try:
                  self[k]._delete()
              except KeyError:
                  pass
          if self.__parent is not None:
              del self.__parent[self.__name]
              self.__parent = None
          cmds.deleteUI(self.__menustring)
docs: Delete the menu and remove it from parent
  
          Deletes all children, so they do not reference to this instance and it can be garbage collected.
          Sets parent to None, so parent is also garbage collectable
  
          This has proven to be very unreliable. so we delete the menu from the parent manually too.
  
          :returns: None
          :rtype: None
          :raises: None