GifBuilder: Ressources not freed
Status: Alpha
Brought to you by:
sbridewell
I think this is a bug.
Here are the steps to reproduce the problem :
Lets add 3 frames, and encode a gif. On my machine it takes 2 or 3 seconds. -> great
Now, i add 50 frames and encode a new gif -> it works, and it takes around 50-60 seconds.
And finaly, i remove all the frames using the _frames.Clear() method, and add 3 frames again.
When i encode the new 3 frames gif, it takes more than 60 seconds !
Clearing the _frames collection in GifBuilder doesn't clear the frames already added to the AnimatedGifEncoder so I suspect your 3rd GIF will contain all 50 frames from the 2nd GIF plus the 3 new ones.
I'm working on a change to AnimatedGifEncoder which exposes its own Frames property, removing the need for the _frames member in GifBuilder - if you call Clear() on this new property then it seems to remove all the old frames OK.
The change is checked into the code repository now, along with a test case AnimatedGifEncoderTest.Bug2892015
those changes are great ! thank you :)