Commits

Anonymous committed d015902

Free surfaces on Python GC

Comments (0)

Files changed (1)

pygame/surface.py

             self._surf = SDL_CreateRGBSurface(flags, width, height, depth,
                 masks[0], masks[1], masks[2], masks[3])
 
+    def __del__(self):
+        self._cleanup()
+
     def _cleanup(self):
         if hasattr(self, '_surf') and self._surf:
             if not (self._surf.flags & SDL_HWSURFACE) or \