workers are not terminated
devjiro76 opened this issue · comments
Devjiro76 commented
Even official demo page 'https://jnordberg.github.io/gif.js/'
Workers are not terminated after generate GIF.
How can I terminate Workers?
Fabian Iwand commented
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.
Fabian Iwand commented
Workaround: The workers can be accessed through GIF.freeWorkers. To clean up, call:
gif.freeWorkers.forEach(w => w.terminate());
iulo commented
Workaround: The workers can be accessed through GIF.freeWorkers. To clean up, call:
gif.freeWorkers.forEach(w => w.terminate());
thanks, save my life
Andrea Doimo commented
You actually have to call
gif.abort();
at it clears a status variable too.