Skip to content

Lottie files using repeaters leak #2151

@radegran

Description

@radegran

Tell us about your environment
lottie-web v5.6.8.

  • Browser and Browser Version:
    Tested in latests Safari/Chrome

  • After Effects Version:
    Not sure. But lottie json files are available. See below.

What did you do? Please explain the steps you took before you encountered the problem.
This call loads an animation:

lottie.loadAnimation({ animationData: json, autoplay: true, container: elem, loop: true, renderer: 'svg', })

I repeat this call with different container elements but using the same json reference.

What did you expect to happen?
Identical animations running in different containers.

What actually happened? Please include as much relevant detail as possible.
For every new animation the number of elements in the svg tag grows exponentially. Seems to be related to the use of "repeaters". Reusing the json data structure quickly leads to performance problems if rendering the animation many times. I could deep clone the json each time and the problem goes away but I would like to avoid that.

Please provide a download link to the After Effects file that demonstrates the problem.
Go to https://leaky-lottie.netlify.app/isolated.html for a demonstration of the problem. View page source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions