Fix crash when removing all scripts

This commit is contained in:
Alexander Batalov 2022-10-30 09:03:24 +03:00
parent 1342fd3ecf
commit 4e98093d6c
1 changed files with 5 additions and 0 deletions

View File

@ -2354,6 +2354,11 @@ int _scr_remove_all()
} else {
next = scriptListExtent->next;
scriptRemove(script->sid);
// CE: Current extent is freed in |scriptRemove|. Break
// to prevent next iteration which needs to dereference
// extent to obtain it's length.
break;
}
}
}