diff --git a/Source/utils/png.h b/Source/utils/png.h index d5b69de3c..be0babe04 100644 --- a/Source/utils/png.h +++ b/Source/utils/png.h @@ -44,7 +44,9 @@ inline void QuitPNG() inline SDL_Surface *LoadPNG(const char *file) { SDL_RWops *rwops = SFileOpenRw(file); - return IMG_LoadPNG_RW(rwops); + SDL_Surface *surface = IMG_LoadPNG_RW(rwops); + SDL_RWclose(rwops); + return surface; } } // namespace devilution