renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
328 stars 65 forks source link

Fix file handle leak when file-like object is subfile #127

Closed uyjulian closed 4 years ago

uyjulian commented 4 years ago

When file-like object is passed to RWopsFromPython, the file handle should be closed with SDL_RWops.
However, the SubFile optimization bypasses this and creates its own SDL_RWops based on the SubFile class information, so the SubFile class should be closed as soon as it is passed into RWopsFromPython.