Kineticjs causes memory leaks. Does not release stage after it is destroyed

262 Views Asked by At

Our Single page Application generates a new stage for a new url route.
We have huge memory leaks.
We have noticed that Kinetic.shapes and Kinetic.names that are global variables are never cleared even after a call for stage.destroy().

The call bellow does not fix the problem:

        this.stage.destroy()
        Kinetic.shapes = [];
        Kinetic.names = [];
        Kinetic.stages = [];

Any Ideas? Thanks

1

There are 1 best solutions below

0
On

What version of kinetic.js are you using? It looks like they fixed a memory leak with stage.destroy() in version 5.1.0 https://github.com/ericdrowell/KineticJS/wiki/Change-Log