mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
audio: conditionally shutdown SFX/Music players
Fixes a potential segfault during startup where the sound hasn't been initialized yet, but an I_Error occurs while loading data.
This commit is contained in:
parent
c5ecec1523
commit
9f649d7701
1 changed files with 4 additions and 2 deletions
|
|
@ -186,7 +186,8 @@ void I_ShutdownSound(void) {
|
|||
SdlAudioLockHandle _;
|
||||
|
||||
for (auto& channel : sound_effect_channels) {
|
||||
*channel = audio::SoundEffectPlayer();
|
||||
if (channel)
|
||||
*channel = audio::SoundEffectPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +330,8 @@ void I_InitMusic(void) {
|
|||
void I_ShutdownMusic(void) {
|
||||
SdlAudioLockHandle _;
|
||||
|
||||
*music_player = audio::MusicPlayer();
|
||||
if (music_player)
|
||||
*music_player = audio::MusicPlayer();
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue