jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.74k stars 668 forks source link

workers are not terminated #96

Open devjiro76 opened 6 years ago

devjiro76 commented 6 years ago

Even official demo page 'https://jnordberg.github.io/gif.js/' Workers are not terminated after generate GIF.

image

How can I terminate Workers?

mootari commented 6 years ago

Also running into this, workers are piling up. .abort() only works for active workers, and reusing the gif instance causes an error when .render() gets called again.

mootari commented 5 years ago

Workaround: The workers can be accessed through GIF.freeWorkers. To clean up, call:

gif.freeWorkers.forEach(w => w.terminate());
iulo commented 5 years ago

Workaround: The workers can be accessed through GIF.freeWorkers. To clean up, call:

gif.freeWorkers.forEach(w => w.terminate());

thanks, save my life

Omiod commented 3 years ago

You actually have to call gif.abort(); at it clears a status variable too.