Fix Stop button: await ci.exit() so emulator process fully terminates before navigation, prevent stale audio
This commit is contained in:
@@ -64,14 +64,19 @@
|
||||
booting = false;
|
||||
}
|
||||
|
||||
function stopEmulator() {
|
||||
if (dosCI) {
|
||||
try { dosCI.exit(); } catch (_) {}
|
||||
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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user