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 () void CMusicPlayer::previous ()
{ {
if (!_Songs.empty()) if (!_Songs.empty())

View file

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

View file

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