Fixer mixer: Mixer Memory Leaks
Fix the memory leaks from the SDL2 Mixer interface. Mix_QuickLoad_RAW loaded Mix_Chunk's don't free the data used in Mix_FreeChunk since we allocated it. So Free it manually in I_FreeSfx. This means the allocation in ds2chunk can go back to being Z_Malloc. The SDL_RWops from SDL_RWFromMem need to be closed after being used.
Merge request reports
Activity
make: Entering directory '/root/SRB2/src' sdl/mixer_sound.c: In function 'I_GetSfx': sdl/mixer_sound.c:390:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] SDL_RWops *rw = SDL_RWFromMem(lump, sfx->length); ^ sdl/mixer_sound.c:393:14: error: declaration of 'chunk' shadows a previous local [-Werror=shadow] Mix_Chunk *chunk = Mix_LoadWAV_RW(rw, 1); ^ sdl/mixer_sound.c:248:13: error: shadowed declaration is here [-Werror=shadow] Mix_Chunk *chunk; ^ sdl/mixer_sound.c: In function 'I_StartDigSong': sdl/mixer_sound.c:661:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] SDL_RWops *rw = SDL_RWFromMem(data, len); ^ cc1: all warnings being treated as errors Makefile:779: recipe for target '../objs/Linux/SDL/Release/mixer_sound.o' failed make: *** [../objs/Linux/SDL/Release/mixer_sound.o] Error 1 make: Target 'all' not remade because of errors. make: Leaving directory '/root/SRB2/src' Exited with code 2
This fix is too unstable, to the point it's not even playable since there is a very high chance it will crash on game startup, or if you're lucky enough to even get to the title screen. That's as far you will be able to get. Can't be my copy of the executable as I made sure to clean before compiling. Although the stuff logged to RPT is interesting. Somehow caused a Privileged Instruction
added 2 commits
Resists top notch
troll WADsstress tests such as earrape.wad, so fine by me.mentioned in commit a5fb2143
mentioned in merge request !278 (merged)