def close(self):
        """Closes the ModalRuntime and associated objects."""
        super().close()

        if not self.attach_to_existing and self.sandbox:
            self.sandbox.terminate()
Closes the ModalRuntime and associated objects.
openhands/runtime/impl/modal/modal_runtime.py