def remove(self):
        """ Deletes this buffer, restoring the previous state """
        self._internal_buffer.clear_render_textures()
        self.engine.remove_window(self._internal_buffer)
        self._active = False
        for target in itervalues(self._targets):
            target.release_all()
        RenderTarget.REGISTERED_TARGETS.remove(self)
 Deletes this buffer, restoring the previous state 
metadrive/render_pipeline/rpcore/render_target.py