Fix resource leak closing SDL RW ops
Leak introduced inb3d134a6b7
("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:
parent
5dace576ae
commit
1f5190bcfd
|
@ -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
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ struct RWops_delete
|
|||
{
|
||||
void operator()(SDL_RWops *o) const
|
||||
{
|
||||
SDL_FreeRW(o);
|
||||
SDL_RWclose(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue