Fix another potential crash in soundemitter.cpp

This commit is contained in:
刘皓 2025-06-30 20:55:32 -04:00
parent 97f862662b
commit d9a6c68d6b
No known key found for this signature in database
GPG key ID: 7901753DB465B711

View file

@ -391,6 +391,7 @@ bool SoundEmitter::sandbox_deserialize(const void *&data, mkxp_sandbox::wasm_siz
if (filenames[i] != value) { if (filenames[i] != value) {
if (filenames[i].empty()) { if (filenames[i].empty()) {
if (old_buffer != nullptr) { if (old_buffer != nullptr) {
AL::Source::stop(source);
SoundBuffer::deref(old_buffer); SoundBuffer::deref(old_buffer);
} }
atchBufs[i] = nullptr; atchBufs[i] = nullptr;