Fix ability to replay wxSound sample on OSX
The sound handle was returned to the OS after the first play completed (or the loop first stopped), making it impossible to replay that sound again. Now the handle is returned upon destruction of the wxSound object. Closes https://github.com/wxWidgets/wxWidgets/pull/1149
This commit is contained in:
@@ -58,6 +58,7 @@ wxOSXAudioToolboxSoundData::wxOSXAudioToolboxSoundData(SystemSoundID soundID) :
|
||||
wxOSXAudioToolboxSoundData::~wxOSXAudioToolboxSoundData()
|
||||
{
|
||||
DoStop();
|
||||
AudioServicesDisposeSystemSoundID (m_soundID);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -95,8 +96,6 @@ void wxOSXAudioToolboxSoundData::DoStop()
|
||||
{
|
||||
m_playing = false;
|
||||
AudioServicesRemoveSystemSoundCompletion(m_soundID);
|
||||
AudioServicesDisposeSystemSoundID (m_soundID);
|
||||
|
||||
wxSound::SoundStopped(this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user