mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user