jnordberg / gif.js

JavaScript GIF encoding library

Home Page:http://jnordberg.github.io/gif.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"running" is never set to "false"

jumpjack opened this issue · comments

The only method setting "running" variable to "false" (after "render()" sets it to "true") is "abort()"; I think render() should set running to false once finished.

I did this: call gif.abort() in the callback function of gif.on("finished") and then running is reset to false

To properly launch multiple time the gif rendering without issues, I had to do the following:
gif.abort(); gif.frames = []; delete gif.imageParts; delete gif.finishedFrames; delete gif.nextFrame;

Yes, I found that there would be problems when rendering a new gif after calling gif.abort(), so I replaced gif.abort() with

// ...
gif.running = false;
gif.frames = [];
// ...