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:
David Alvarez
2026-05-23 19:16:14 +02:00
parent 40aede0dfc
commit a3ba5f8098
+4 -15
View File
@@ -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(); });