image/gif: avoid setting defers in the decode loop
decoder.decode() was defering close of lzw.decoders created for each frame in a loop, thus increasing heap usage (referenced object + defered function) until decode() returns. Memory increased proportionally to the number of frames. Fix this by moving the sImageDescriptor case block into its own method. Fixes #22237 Change-Id: I819617ea7e539e13c04bc11112f339645391ddb9 Reviewed-on: https://go-review.googlesource.com/70370 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Showing
Please
register
or
sign in
to comment