quickjs icon indicating copy to clipboard operation
quickjs copied to clipboard

Worker.parent.onmessage not set to null in test_worker_module.js test

Open chemwolf6922 opened this issue 4 years ago • 0 comments

In the test 'test_worker.js', after parent thread set worker.onmesssage to null and 'terminated' the worker, the worker would still be running since its parent.onmessage was not set to null.
This does not matter in this test, since the parent thread will exit soon afterwards. However, if there were any more async operations in the parent thread, the detached worker would always be running in the background.
Thus, please consider setting parent.onmessage to null after the worker posts 'done' to its parent in this test/example.

chemwolf6922 avatar Oct 27 '21 02:10 chemwolf6922