Skip to content

Commit

Permalink
Merge pull request #1 from xeviknal/car-racing-leak-fix
Browse files Browse the repository at this point in the history
Memmory leak fixed: pyglet reference not deleted
  • Loading branch information
xeviknal committed Feb 11, 2021
2 parents 8a721ac + 7711164 commit b5caf15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gym/envs/box2d/car_racing.py
Expand Up @@ -528,6 +528,7 @@ def render_road(self):
len(polygons_) // 3, ("v3f", polygons_), ("c4f", colors) # gl.GL_QUADS,
)
vl.draw(gl.GL_QUADS)
vl.delete()

def render_indicators(self, W, H):
s = W / 40.0
Expand Down Expand Up @@ -589,6 +590,7 @@ def horiz_ind(place, val, color):
len(polygons) // 3, ("v3f", polygons), ("c4f", colors) # gl.GL_QUADS,
)
vl.draw(gl.GL_QUADS)
vl.delete()
self.score_label.text = "%04i" % self.reward
self.score_label.draw()

Expand Down

0 comments on commit b5caf15

Please sign in to comment.