Skip to content

Commit

Permalink
Fixed bug 2004 - Calling Mix_Quit twice with midi support leads to se…
Browse files Browse the repository at this point in the history
…gfault

Martin Gerhardy

the variable soundfont_paths is freed, but not set to NULL. So calling Mix_Quit a second time would crash if SDL_mixer is compiled with midi support. For all the other sound types, it's guarded with if (initialized). So i think it would be good to fix this by setting the soundfont_paths variable to NULL in line 231 of mixer.c
  • Loading branch information
slouken committed Aug 1, 2013
1 parent 54af43b commit bc8f83b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mixer.c
Expand Up @@ -243,6 +243,7 @@ void Mix_Quit()
#ifdef MID_MUSIC
if (soundfont_paths) {
SDL_free(soundfont_paths);
soundfont_paths = NULL;
}
#endif
initialized = 0;
Expand Down

0 comments on commit bc8f83b

Please sign in to comment.