Ver Fonte

mol-plugin: PluginState.dispose unregisters behaviors

David Sehnal há 5 anos atrás
pai
commit
68e8d67054
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      src/mol-plugin/state.ts

+ 6 - 0
src/mol-plugin/state.ts

@@ -114,6 +114,12 @@ class PluginState extends PluginComponent {
     }
 
     dispose() {
+        this.behaviors.cells.forEach(cell => {
+            if (PluginBehavior.Behavior.is(cell.obj)) {
+                cell.obj.data.unregister();
+            }
+        });
+
         super.dispose();
         this.data.dispose();
         this.behaviors.dispose();