Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
benmoran56 committed May 10, 2024
2 parents cfe0554 + 823f220 commit 9553290
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyglet/shapes.py
Expand Up @@ -395,12 +395,14 @@ def draw(self) -> None:
def delete(self) -> None:
"""Force immediate removal of the shape from video memory.
You should usually call this whenever you delete a shape. Unless
you are using manual garbage collection, Python might not call
the finalizer as soon as the sprite falls out of scope.
Manual garbage collection is a very advanced technique. See
Python's :py:mod:`gc` module documentation to learn more.
You should usually call this whenever you no longer need the shape.
Otherwise, Python may call the finalizer of the shape instance only
some time after the shape has fallen out of scope, and the shape's video
memory will not be freed until the finalizer is eventually called by
garbage collection.
Implementing manual garbage collection may satisfy the same concern
without using the current method, but is a very advanced technique.
"""
if self._vertex_list is not None:
self._vertex_list.delete()
Expand Down

0 comments on commit 9553290

Please sign in to comment.