def close(self):
        """Override _close in your subclass to perform any necessary cleanup.

        Environments will automatically close() themselves when
        garbage collected or when the program exits.

        Also close the rendering threads, if any.
        """
        # _closed will be missing if this instance is still
        # initializing.
        if not hasattr(self, '_closed') or self._closed:
            return
        self._close()
        # If an error occurs before this line, it's possible to
        # end up with double close.
        self._closed = True
Override _close in your subclass to perform any necessary cleanup.

        Environments will automatically close() themselves when
        garbage collected or when the program exits.

        Also close the rendering threads, if any.
        
surreal/env/base.py