-
I was attempting to use I tried it with the parallel raytrace example: diff --git a/examples/raytrace-parallel/worker.js b/examples/raytrace-parallel/worker.js
index 26d40c62d..6fa949c3c 100644
--- a/examples/raytrace-parallel/worker.js
+++ b/examples/raytrace-parallel/worker.js
@@ -19,7 +19,8 @@ self.onmessage = event => {
self.onmessage = async event => {
// This will queue further commands up until the module is fully initialised:
- await initialised;
+ let wasm = await initialised;
wasm_bindgen.child_entry_point(event.data);
+ wasm.__wbindgen_thread_destroy();
};
}; Error message
I think adding it might make sure that it doesn't break in the future, or if I'm doing something wrong it would show us how to use it properly. Friendly ping @jrvidal, maybe you can answer this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Do you get the errors after the first click/render? Or on subsequent renders? The latter is expected b/c the code in the raytracer example reuses workers, so there's really not a natural point where a worker is ready to be destroyed. |
Beta Was this translation helpful? Give feedback.
-
After debugging my example a bit. I found out that it actually works, I was accidentally using some local build of |
Beta Was this translation helpful? Give feedback.
After debugging my example a bit. I found out that it actually works, I was accidentally using some local build of
wasm-bindgen
where I messed something up related to #3062.