Skip to content

Commit

Permalink
Quit Pygame when cliffwalking environment is closed (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmikler authored Jan 24, 2025
1 parent 08a28d3 commit 5bc344e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gymnasium/envs/toy_text/cliffwalking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ____

0 comments on commit 5bc344e

Please sign in to comment.