Fix Stop button: await ci.exit() so emulator process fully terminates before navigation, prevent stale audio
This commit is contained in:
1 parent
3f41f6f678
commit
40aede0dfc
1 file changed
+9
-4
@@ -64,14 +64,19 @@
|
|||||||
booting = false;
|
booting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopEmulator() {
|
async function stopEmulator() {
|
||||||
if (dosCI) {
|
// Save reference then null it so the unmount cleanup doesn't double-try
|
||||||
try { dosCI.exit(); } catch (_) {}
|
const ci = dosCI;
|
||||||
dosCI = null;
|
dosCI = null;
|
||||||
|
|
||||||
|
// Properly stop the emulator
|
||||||
|
if (ci) {
|
||||||
|
try { await ci.exit(); } catch (_) {}
|
||||||
}
|
}
|
||||||
if (dosContainer) {
|
if (dosContainer) {
|
||||||
dosContainer.innerHTML = "";
|
dosContainer.innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
running = false;
|
running = false;
|
||||||
push(`/game/${game.id}`);
|
push(`/game/${game.id}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user