mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 16:26:18 +00:00
Fixed: #1032 Crash in OpenAL driver when a music is playing and user quit client
This commit is contained in:
parent
c64390bb7d
commit
fb42c14526
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