ソースを参照

Stop animation loop on dispose

dsehnal 2 年 前
コミット
c2ab322bd2
3 ファイル変更6 行追加1 行削除
  1. 4 1
      CHANGELOG.md
  2. 1 0
      src/mol-canvas3d/canvas3d.ts
  3. 1 0
      src/mol-plugin/context.ts

+ 4 - 1
CHANGELOG.md

@@ -6,7 +6,10 @@ Note that since we don't clearly distinguish between a public and private interf
 
 ## [Unreleased]
 
-- allow link cylinder/line `dashCount` set to '0'
+## [v3.31.4] - 2023-02-24
+
+- Allow link cylinder/line `dashCount` set to '0'
+- Stop animation loop when disposing `PluginContext` (thanks @gfrn for identifying the issue)
 
 ## [v3.31.3] - 2023-02-22
 

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

@@ -908,6 +908,7 @@ namespace Canvas3D {
             },
             dispose: () => {
                 contextRestoredSub.unsubscribe();
+                cancelAnimationFrame(animationFrameHandle);
 
                 markBuffer = [];
 

+ 1 - 0
src/mol-plugin/context.ts

@@ -362,6 +362,7 @@ export class PluginContext {
         }
         this.subs = [];
 
+        this.animationLoop.stop();
         this.commands.dispose();
         this.canvas3d?.dispose();
         this.canvas3dContext?.dispose(options);