瀏覽代碼

DownloadScreenshotControls: componentWillUnmount

This should solve the error:

Warning: Can't perform a React state update on an unmounted component.
This is a no-op, but it indicates a memory leak in your application.
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
Simeon Borko 2 年之前
父節點
當前提交
21f910a3ca
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/mol-plugin-ui/viewport/screenshot.tsx

+ 1 - 0
src/mol-plugin-ui/viewport/screenshot.tsx

@@ -58,6 +58,7 @@ export class DownloadScreenshotControls extends PluginUIComponent<{ close: () =>
     }
 
     componentWillUnmount() {
+        super.componentWillUnmount();
         this.setState({ imageData: void 0 });
     }