1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-29 07:58:30 +02:00

Unconditionally call FILESYSTEM_freeMemory() in SoundTrack constructor

Previously, it was guarded behind a check for the length, which is... I
guess still perfectly fine behavior, but there's no reason to have a
length check here; FILESYSTEM_freeMemory() uses SDL_free(), which does a
check that the pointer passed is non-NULL (the pointer that is passed
here, despite not being initialized upon declaration, is guaranteed to
be initialized by FILESYSTEM_loadFileToMemory() anyway, so).
This commit is contained in:
Misa 2021-02-15 19:05:01 -08:00 committed by Ethan Lee
parent b19daebeef
commit f401cc6230

View File

@ -35,10 +35,7 @@ SoundTrack::SoundTrack(const char* fileName)
FILESYSTEM_loadFileToMemory(fileName, &mem, &length);
SDL_RWops *fileIn = SDL_RWFromMem(mem, length);
sound = Mix_LoadWAV_RW(fileIn, 1);
if (length)
{
FILESYSTEM_freeMemory(&mem);
}
FILESYSTEM_freeMemory(&mem);
if (sound == NULL)
{