| Summary: | Mix_FreeMusic doesn't close the file handle when playing WAVE audio | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | jjs |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.11 | ||
| Hardware: | All | ||
| OS: | Other | ||
Fixed, thanks! http://hg.libsdl.org/SDL_mixer/rev/565549e046b0 |
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); }