mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Fixed: #1032 Crash in OpenAL driver when a music is playing and user quit client
This commit is contained in:
parent
aa446917b9
commit
bf5e086157
3 changed files with 16 additions and 4 deletions
|
@ -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())
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue