Web Workers: Terminate a Web Worker

w.terminate();

When a web worker object is created, it will continue to listen for messages (even after the external script is finished) until it is terminated.

To terminate a web worker, and free browser/computer resources, use the terminate() method.

Related concepts

Terminate a Web Worker

Web Workers: Terminate a Web Worker — Structure map

Clickable & Draggable!

Web Workers: Terminate a Web Worker — Related pages: