Fixed: #1032 Crash in OpenAL driver when a music is playing and user quit client

This commit is contained in:
kervala 2010-07-27 19:32:15 +02:00
parent aa446917b9
commit bf5e086157
3 changed files with 16 additions and 4 deletions

View file

@ -103,6 +103,17 @@ void CMusicPlayer::pause ()
// ***************************************************************************
void CMusicPlayer::stop ()
{
if(!SoundMngr)
return;
// stop the music only if we are really playing (else risk to stop a background music!)
SoundMngr->stopMusic(0);
_State = Stopped;
}
// ***************************************************************************
void CMusicPlayer::previous ()
{
if (!_Songs.empty())

View file

@ -46,6 +46,7 @@ public:
void playSongs (const std::vector<CSongs> &songs);
void play (); // Play the song at current position, if playing, restart. If paused, resume.
void pause ();
void stop ();
void previous ();
void next ();

View file

@ -212,8 +212,8 @@ void releaseMainLoopReselect()
// alredy called from farTPMainLoop()
// --R2::getEditor().autoConfigRelease(IsInRingSession);
// Pause any user played music
MusicPlayer.pause();
// Stop the music
MusicPlayer.stop();
// only really needed at exit
// --STRING_MANAGER::CStringManagerClient::instance()->flushStringCache();
@ -362,8 +362,8 @@ void releaseMainLoop(bool closeConnection)
// Release R2 editor if applicable
R2::getEditor().autoConfigRelease(IsInRingSession);
// Pause the music
MusicPlayer.pause();
// Stop the music
MusicPlayer.stop();
// flush the server string cache
STRING_MANAGER::CStringManagerClient::instance()->flushStringCache();