Fixed bgm stopping order if BGM not found (should first stop existing BGM, and then free its resources).
This commit is contained in:
parent
0ad5a46c75
commit
319d844b7a
1 changed files with 1 additions and 1 deletions
|
@ -134,9 +134,9 @@ void start_bgm(char *name) {
|
|||
if((current_bgm.data = get_snd(resources.music, name)) == NULL)
|
||||
{
|
||||
warnx("start_bgm():\n!- BGM '%s' not exist", current_bgm.name);
|
||||
stop_bgm();
|
||||
free(current_bgm.name);
|
||||
current_bgm.name = NULL;
|
||||
stop_bgm();
|
||||
return;
|
||||
}
|
||||
alSourceRewind(resources.bgmsrc);
|
||||
|
|
Loading…
Reference in a new issue