Explorar el Código

fix memory leak, reprUpdatedSubscriptions not removed

Alexander Rose hace 5 años
padre
commit
a18484a5dd
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/mol-canvas3d/canvas3d.ts

+ 2 - 0
src/mol-canvas3d/canvas3d.ts

@@ -298,6 +298,8 @@ namespace Canvas3D {
                 }
             },
             clear: () => {
+                reprUpdatedSubscriptions.forEach(v => v.unsubscribe())
+                reprUpdatedSubscriptions.clear()
                 reprRenderObjects.clear()
                 scene.clear()
                 debugHelper.clear()