]> git.kaiwu.me - quickjs.git/commitdiff
fix worker termination in example (github issue #98)
authorFabrice Bellard <fabrice@bellard.org>
Mon, 8 Jan 2024 17:41:03 +0000 (18:41 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 8 Jan 2024 17:41:03 +0000 (18:41 +0100)
tests/test_worker_module.js

index c783e1fecb94315d96bd8ccd6c1dd46fccd4269f..f19600ac53caebc979123069445b5e2dcbeafc1e 100644 (file)
@@ -10,6 +10,7 @@ function handle_msg(e) {
     switch(ev.type) {
     case "abort":
         parent.postMessage({ type: "done" });
+        parent.onMessage = null; /* terminate the worker */
         break;
     case "sab":
         /* modify the SharedArrayBuffer */