Fix resource leak closing SDL RW ops

Leak introduced in b3d134a6b7 ("merged
physfs branch"), but this fix only applies after the conversion to RAII.
An equivalent change from SDL_FreeRW->SDL_RWclose is needed for pre-RAII
code.

Fixes: d0de0cf963 ("Use unique_ptr for SDL_RWops")
This commit is contained in:
Kp 2015-02-28 22:34:07 +00:00
parent 5dace576ae
commit 1f5190bcfd
2 changed files with 5 additions and 2 deletions

View file

@ -31,7 +31,10 @@ class current_music_t
{
struct RWops_delete
{
void operator()(SDL_RWops *o) { SDL_FreeRW(o); }
void operator()(SDL_RWops *o)
{
SDL_RWclose(o);
}
};
struct Music_delete
{

View file

@ -42,7 +42,7 @@ struct RWops_delete
{
void operator()(SDL_RWops *o) const
{
SDL_FreeRW(o);
SDL_RWclose(o);
}
};