mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
- fixed crash when exiting before sound engine initialization
https://forum.zdoom.org/viewtopic.php?t=66605
This commit is contained in:
parent
47305a740f
commit
430a6f3247
1 changed files with 8 additions and 5 deletions
|
@ -741,10 +741,14 @@ void FPlayerSoundHashTable::MarkUsed()
|
|||
|
||||
void S_ClearSoundData()
|
||||
{
|
||||
soundEngine->StopAllChannels();
|
||||
soundEngine->UnloadAllSounds();
|
||||
auto &S_sfx = soundEngine->GetSounds();
|
||||
S_sfx.Clear();
|
||||
if (soundEngine)
|
||||
{
|
||||
soundEngine->StopAllChannels();
|
||||
soundEngine->UnloadAllSounds();
|
||||
soundEngine->GetSounds().Clear();
|
||||
soundEngine->ClearRandoms();
|
||||
}
|
||||
|
||||
Ambients.Clear();
|
||||
while (MusicVolumes != NULL)
|
||||
{
|
||||
|
@ -752,7 +756,6 @@ void S_ClearSoundData()
|
|||
MusicVolumes = me->Next;
|
||||
M_Free(me);
|
||||
}
|
||||
soundEngine->ClearRandoms();
|
||||
|
||||
NumPlayerReserves = 0;
|
||||
PlayerClassesIsSorted = false;
|
||||
|
|
Loading…
Reference in a new issue