mirror of https://github.com/ZDoom/qzdoom.git
- 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
|
@ -741,10 +741,14 @@ void FPlayerSoundHashTable::MarkUsed()
|
||||||
|
|
||||||
void S_ClearSoundData()
|
void S_ClearSoundData()
|
||||||
{
|
{
|
||||||
soundEngine->StopAllChannels();
|
if (soundEngine)
|
||||||
soundEngine->UnloadAllSounds();
|
{
|
||||||
auto &S_sfx = soundEngine->GetSounds();
|
soundEngine->StopAllChannels();
|
||||||
S_sfx.Clear();
|
soundEngine->UnloadAllSounds();
|
||||||
|
soundEngine->GetSounds().Clear();
|
||||||
|
soundEngine->ClearRandoms();
|
||||||
|
}
|
||||||
|
|
||||||
Ambients.Clear();
|
Ambients.Clear();
|
||||||
while (MusicVolumes != NULL)
|
while (MusicVolumes != NULL)
|
||||||
{
|
{
|
||||||
|
@ -752,7 +756,6 @@ void S_ClearSoundData()
|
||||||
MusicVolumes = me->Next;
|
MusicVolumes = me->Next;
|
||||||
M_Free(me);
|
M_Free(me);
|
||||||
}
|
}
|
||||||
soundEngine->ClearRandoms();
|
|
||||||
|
|
||||||
NumPlayerReserves = 0;
|
NumPlayerReserves = 0;
|
||||||
PlayerClassesIsSorted = false;
|
PlayerClassesIsSorted = false;
|
||||||
|
|
Loading…
Reference in New Issue