Skip to content
Snippets Groups Projects

Fixer mixer: Mixer Memory Leaks

Merged Sryder requested to merge Sryder/SRB2:fixer-mixer into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • https://circleci.com/gh/STJr/SRB2/432?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

    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

  • Contributor

    Just to note why this popped up: the previous fix for this has been incredibly unstable, sounds started to crash the game when SRB2 next was merged into Kart

  • Sryder added 2 commits

    added 2 commits

    Compare with previous version

  • Contributor

    Resists top notch troll WADs stress tests such as earrape.wad, so fine by me.

  • Monster Iestyn mentioned in commit a5fb2143

    mentioned in commit a5fb2143

  • All made sense to me, so I merged it in.

  • mazmazz mentioned in merge request !278 (merged)

    mentioned in merge request !278 (merged)

Please register or sign in to reply
Loading