We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1168

Summary: Mix_FreeMusic doesn't close the file handle when playing WAVE audio
Product: SDL_mixer Reporter: jjs
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.11   
Hardware: All   
OS: Other   

Description jjs 2011-03-11 11:37:57 UTC
When using SDL_Mixer to play WAVE music, the call to Mix_FreeMusic does not close the associated file handle.

There is a check in WAVStream_FreeSong() of wavestream.c like this:

if ( wave->freerw ) {
  SDL_FreeRW(wave->rw);
}

But the variable freerw is not referenced anywhere else. SDL_FreeRW would also not close the file from what I can tell.

Something like this should do the trick:

if ( wave->rw ) {
  SDL_RWclose(wave->rw);
}
Comment 1 Sam Lantinga 2011-12-31 15:34:25 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL_mixer/rev/565549e046b0