Fix Stop button killing audio: use full page reload to terminate Web Workers and AudioContexts that js-dos spawns internally
This commit is contained in:
@@ -64,21 +64,10 @@
|
||||
booting = false;
|
||||
}
|
||||
|
||||
async function stopEmulator() {
|
||||
// Save reference then null it so the unmount cleanup doesn't double-try
|
||||
const ci = dosCI;
|
||||
dosCI = null;
|
||||
|
||||
// Properly stop the emulator
|
||||
if (ci) {
|
||||
try { await ci.exit(); } catch (_) {}
|
||||
}
|
||||
if (dosContainer) {
|
||||
dosContainer.innerHTML = "";
|
||||
}
|
||||
|
||||
running = false;
|
||||
push(`/game/${game.id}`);
|
||||
function stopEmulator() {
|
||||
// Full page reload to guarantee all workers, AudioContexts,
|
||||
// and WebAssembly threads are fully terminated
|
||||
window.location.href = `/#/game/${game.id}`;
|
||||
}
|
||||
|
||||
$effect(() => { load(); });
|
||||
|
||||
Reference in New Issue
Block a user