No, the message event is still bound to the work object.
You can remove the event using the removeEventListener () property of the worker object, or since you probably did with the worker, set the work object to null to make sure it has garbage collected.
Here is a test you can use to provide this on your platform:
var worker = new Worker( URL.createObjectURL( new Blob([''])));
var e = new MessageEvent('message');
function test() { console.log('Event fired') }
worker.addEventListener('message', test);
worker.dispatchEvent(e);
worker.terminate();
worker.dispatchEvent(e);
I get the same results in chrome and firefox.
source
share