diff --git a/examples/nodejs.js b/examples/nodejs.js index f08b54d4..c2ec8246 100755 --- a/examples/nodejs.js +++ b/examples/nodejs.js @@ -38,7 +38,7 @@ process.stdin.on("data", function(c) if(c === "\u0003") { // ctrl c - emulator.stop(); + emulator.destroy(); process.stdin.pause(); } else diff --git a/examples/nodejs_state.js b/examples/nodejs_state.js index e829cb09..229f2c14 100755 --- a/examples/nodejs_state.js +++ b/examples/nodejs_state.js @@ -42,7 +42,7 @@ process.stdin.on("data", async function(c) if(c === "\u0003") { // ctrl c - emulator.stop(); + emulator.destroy(); process.stdin.pause(); } else if(c === "\x1b\x4f\x51") diff --git a/src/browser/main.js b/src/browser/main.js index a4581cb2..c65f443b 100644 --- a/src/browser/main.js +++ b/src/browser/main.js @@ -1997,7 +1997,7 @@ $("exit").onclick = function() { - emulator.stop(); + emulator.destroy(); location.href = location.pathname; }; diff --git a/tests/api/clean-shutdown.js b/tests/api/clean-shutdown.js index 5e011f9c..f645d822 100755 --- a/tests/api/clean-shutdown.js +++ b/tests/api/clean-shutdown.js @@ -1,7 +1,7 @@ #!/usr/bin/env node "use strict"; -// This test checks that calling emulator.stop() will remove all event +// This test checks that calling emulator.destroy() will remove all event // listeners, so that the nodejs process cleanly and automatically exits. const TEST_RELEASE_BUILD = +process.env.TEST_RELEASE_BUILD; @@ -28,6 +28,6 @@ const emulator = new V86(config); setTimeout(function() { console.error("Calling stop()"); - emulator.stop(); + emulator.destroy(); console.error("Called stop()"); }, 3000); diff --git a/tests/api/floppy-insert-eject.js b/tests/api/floppy-insert-eject.js index 2f5aa988..f6536e6c 100755 --- a/tests/api/floppy-insert-eject.js +++ b/tests/api/floppy-insert-eject.js @@ -44,7 +44,7 @@ setTimeout(async () => emulator.keyboard_send_text("dir A:\n"); await emulator.wait_until_vga_screen_contains("FDOS "); console.log("Got FDOS"); - emulator.stop(); + emulator.destroy(); clearTimeout(timeout); //clearInterval(interval); }, 1000); diff --git a/tests/api/reboot.js b/tests/api/reboot.js index 1cf54eb8..03b454d8 100755 --- a/tests/api/reboot.js +++ b/tests/api/reboot.js @@ -44,7 +44,7 @@ emulator.add_listener("serial0-output-byte", function(byte) if(serial_text.endsWith("Files send via emulator appear in /mnt/")) { console.log("Ok"); - emulator.stop(); + emulator.destroy(); clearTimeout(timeout); } } diff --git a/tests/api/reset.js b/tests/api/reset.js index d4657dd8..630d2abc 100755 --- a/tests/api/reset.js +++ b/tests/api/reset.js @@ -36,7 +36,7 @@ emulator.add_listener("serial0-output-byte", function(byte) serial_text = ""; if(did_restart) { console.log("Ok"); - emulator.stop(); + emulator.destroy(); } else { console.log("Calling restart()"); diff --git a/tests/api/serial.js b/tests/api/serial.js index 88ab4c3a..d9e1e45e 100755 --- a/tests/api/serial.js +++ b/tests/api/serial.js @@ -49,6 +49,6 @@ emulator.add_listener("serial0-output-byte", function(byte) assert("da1fb5b421123c58080a59832675632505b8c139a8d7ecd1c31591ca5c65cea6" === hash.digest("hex")); console.log("ok"); clearTimeout(timeout); - emulator.stop(); + emulator.destroy(); } }); diff --git a/tests/api/state.js b/tests/api/state.js index 91a6180f..152e2136 100755 --- a/tests/api/state.js +++ b/tests/api/state.js @@ -87,7 +87,7 @@ async function run_test(name, config, done) } console.log("Done: %s", name); - emulator.stop(); + emulator.destroy(); } (async function() { diff --git a/tests/benchmark/arch-bytemark.js b/tests/benchmark/arch-bytemark.js index 887d6c91..a9d13c9b 100755 --- a/tests/benchmark/arch-bytemark.js +++ b/tests/benchmark/arch-bytemark.js @@ -69,7 +69,7 @@ emulator.add_listener("serial0-output-byte", function(byte) if(line === "* Trademarks are property of their respective holder.") { - emulator.stop(); + emulator.destroy(); if(BENCH_COLLECT_STATS) { diff --git a/tests/benchmark/arch-python.js b/tests/benchmark/arch-python.js index c68e6120..1d16a104 100755 --- a/tests/benchmark/arch-python.js +++ b/tests/benchmark/arch-python.js @@ -54,7 +54,7 @@ emulator.add_listener("serial0-output-byte", function(byte) if(line.startsWith("sys")) { - emulator.stop(); + emulator.destroy(); if(BENCH_COLLECT_STATS) { diff --git a/tests/benchmark/linux-boot.js b/tests/benchmark/linux-boot.js index 07e6c1b6..81529d76 100755 --- a/tests/benchmark/linux-boot.js +++ b/tests/benchmark/linux-boot.js @@ -71,7 +71,7 @@ emulator.add_listener("serial0-output-byte", function(byte) const end_time = Date.now(); const elapsed = end_time - start_time; console.log("Done in %dms", elapsed); - emulator.stop(); + emulator.destroy(); if(BENCH_COLLECT_STATS) { diff --git a/tests/devices/fetch_network.js b/tests/devices/fetch_network.js index 244ec5e2..373007c6 100755 --- a/tests/devices/fetch_network.js +++ b/tests/devices/fetch_network.js @@ -265,7 +265,6 @@ emulator.add_listener("serial0-output-byte", function(byte) if(test_num >= tests.length) { - emulator.stop(); emulator.destroy(); console.log("Tests finished."); diff --git a/tests/devices/virtio_console.js b/tests/devices/virtio_console.js index 6d88a1a5..beec4da4 100755 --- a/tests/devices/virtio_console.js +++ b/tests/devices/virtio_console.js @@ -59,7 +59,7 @@ emulator.add_listener("serial0-output-byte", function(byte) if(line.endsWith("pong")) { console.log("\nTest passed"); - emulator.stop(); + emulator.destroy(); } }); diff --git a/tests/devices/wisp_network.js b/tests/devices/wisp_network.js index b20af10f..f8bad868 100755 --- a/tests/devices/wisp_network.js +++ b/tests/devices/wisp_network.js @@ -162,7 +162,6 @@ emulator.add_listener("serial0-output-byte", function(byte) if(test_num >= tests.length) { - emulator.stop(); emulator.destroy(); console.log("Tests finished."); diff --git a/tests/full/run.js b/tests/full/run.js index 744cadc8..4685166e 100755 --- a/tests/full/run.js +++ b/tests/full/run.js @@ -1146,7 +1146,6 @@ function run_test(test, done) clearInterval(screen_interval); } - emulator.stop(); emulator.destroy(); if(test.failure_allowed) diff --git a/tests/jit-paging/run.js b/tests/jit-paging/run.js index 735e09d5..4bdc903c 100755 --- a/tests/jit-paging/run.js +++ b/tests/jit-paging/run.js @@ -63,7 +63,7 @@ emulator.add_listener("serial0-output-byte", async function(byte) const data = await emulator.read_file("/result"); - emulator.stop(); + emulator.destroy(); let result = Buffer.from(data).toString(); if(result !== "test_shared passed\ntest_consecutive_written passed\n") diff --git a/tests/manual/gc.html b/tests/manual/gc.html index 2c9651ae..68053de9 100644 --- a/tests/manual/gc.html +++ b/tests/manual/gc.html @@ -19,7 +19,6 @@ window.onload = function() }); setTimeout(() => { - emulator.stop(); emulator.destroy(); console.log("Emulator freed. Check using devtools (in chromium: Memory -> Heap Snapshot -> click collect garbage -> take snapshot)."); }, 3 * 1000); diff --git a/tests/qemu/run.js b/tests/qemu/run.js index 51c593fc..b4b0d7d2 100755 --- a/tests/qemu/run.js +++ b/tests/qemu/run.js @@ -64,6 +64,6 @@ emulator.add_listener("serial0-output-byte", async function(byte) console.error("Got result, writing to stdout"); process.stdout.write(Buffer.from(data)); - emulator.stop(); + emulator.destroy(); } }); diff --git a/tools/docker/alpine/build-state.js b/tools/docker/alpine/build-state.js index 2a2f3341..fd866b9b 100755 --- a/tools/docker/alpine/build-state.js +++ b/tools/docker/alpine/build-state.js @@ -51,7 +51,7 @@ emulator.add_listener("serial0-output-byte", function(byte) { if(e) throw e; console.log("Saved as " + OUTPUT_FILE); - emulator.stop(); + emulator.destroy(); }); }, 10 * 1000); }