To support playing async sounds on the stack on Mac, do not delete the wxSoundData when its wxSound object is destroyed if it's in the queue of sounds to be played. Instead, mark it to be deleted and delete it after it has played.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2009-12-30 17:41:29 +00:00
parent c896c76129
commit 509da835c5
4 changed files with 38 additions and 3 deletions

View File

@@ -30,6 +30,9 @@ public :
virtual void Stop();
// can be called by a timer for repeated tasks during playback
virtual void SoundTask();
// mark this to be deleted
virtual void MarkForDeletion();
virtual bool IsMarkedForDeletion() const { return m_markedForDeletion; }
// does the true work of stopping and cleaning up
virtual void DoStop() = 0;
@@ -38,6 +41,7 @@ protected :
unsigned int m_flags;
wxSoundTimer* m_pTimer;
bool m_markedForDeletion;
} ;
class WXDLLIMPEXP_ADV wxSound : public wxSoundBase