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 4573 - macOS MIDI: memory leak when freeing song
Summary: macOS MIDI: memory leak when freeing song
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.4
Hardware: x86_64 macOS 10.13
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-30 14:11 UTC by ioanch
Modified: 2019-07-03 09:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ioanch 2019-03-30 14:11:03 UTC
I've discovered a memory leak when using MIDI music on macOS (I'm on Mojave).

When freeing a song, DisposeMusicSequence returns error "kAudioToolboxErr_CannotDoInCurrentContext" (-10863, https://www.osstatus.com/search/results?platform=all&framework=all&search=-10863 ), unless you call "MusicPlayerSetSequence(song->player, NULL);" before it.

See my fix I did on my fork of SDL2_mixer here: https://bitbucket.org/ichera/sdl_mixer/commits/713acbd976efd31c441e37906d76b7fa790572dd?at=macos-music-leak-fix
Comment 1 Ozkan Sezer 2019-04-04 09:39:04 UTC
Ryan, is this patch correct?
Comment 2 Ozkan Sezer 2019-07-03 08:32:13 UTC
Ryan:  Should we apply this?
Comment 3 Sam Lantinga 2019-07-03 09:32:16 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL_mixer/rev/1c557e8ac98f