Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion runtime/libs/snd989.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2853,9 +2853,19 @@ namespace bozo::libs::snd989
for (auto it = I.banks.begin(); it != I.banks.end(); ++it)
if ((*it)->address == address)
{
Impl::Bank *b = it->get();
// The bank's sounds still playing stop first, at once (as StopAllSounds stops each): the driver's
// unload does, and a match's music, played from its bank, otherwise went on over the menus after the
// match was quit (TMB: the level's banks unloaded on leaving, no StopAllSounds sent).
for (Impl::Handler *h = I.hHead; h;)
{
Impl::Handler *next = h->next;
if (h->bank == b)
I.stopHandler(h, true);
h = next;
}
if ((*it)->spu)
I.spuFree((*it)->spu, (*it)->spuBytes);
Impl::Bank *b = it->get();
std::erase_if(I.blocks, [&](const Impl::Block &k) { return k.owner == b; });
I.retired.push_back(std::move(*it));
I.banks.erase(it);
Expand Down
Loading