1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-05 02:39:41 +01:00

Pass 1 to Mix_LoadMUS_RW() in MusicTrack::MusicTrack()

This makes the freesrc argument of Mix_LoadMUS_RW() 1 instead of 0. If
the argument is nonzero, then the passed SDL_RWops will be automatically
freed when m_music is freed, too.

I don't know why this was 0 before. Setting it to 1 fixes a memory leak
that Valgrind reports (which turns into an actual leak every time custom
assets are mounted or unmounted).
This commit is contained in:
Misa 2021-02-15 19:09:51 -08:00 committed by Ethan Lee
parent 8052f61cef
commit 16fef54ae1

View file

@ -17,7 +17,7 @@ MusicTrack::MusicTrack(const char* fileName)
MusicTrack::MusicTrack(SDL_RWops *rw)
{
m_music = Mix_LoadMUS_RW(rw, 0);
m_music = Mix_LoadMUS_RW(rw, 1);
m_isValid = true;
if(m_music == NULL)
{