mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 10:59:45 +01: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:
parent
b19daebeef
commit
f401cc6230
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue