diff --git a/gymnasium/envs/toy_text/cliffwalking.py b/gymnasium/envs/toy_text/cliffwalking.py index fddf5bcaa..e8d0b14c5 100644 --- a/gymnasium/envs/toy_text/cliffwalking.py +++ b/gymnasium/envs/toy_text/cliffwalking.py @@ -345,6 +345,13 @@ def _render_text(self): with closing(outfile): return outfile.getvalue() + def close(self): + if self.window_surface is not None: + import pygame + + pygame.display.quit() + pygame.quit() + # Elf and stool from https://franuka.itch.io/rpg-snow-tileset # All other assets by ____