Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix HTJ2K decoder leak #1388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jul 11, 2024

  1. fix: Fix HTJ2K decoder leak

    Commit 85fd193 changed decodeHTJ2K.js
    to allocate a new HTJ2KDecoder with each call to decodeAsync. The old
    decoders somehow stay alive, and are not cleaned from the WASM memory.
    Each new HTJ2KDecoder allocates in turns buffers for the encoded and
    decoded pixel data while decoding.
    
    The change to allocate a new decoder per frame argued that reusing the
    old decoder is "much slower", but I could not reproduce any slowdowns
    either in the browser or on Node. This commit therefore reverts the
    change, so that each call to decodeAsync reuses the same decoder
    instance.
    abustany committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    e72f82a View commit details
    Browse the repository at this point in the history