|
@@ -1266,11 +1266,17 @@ export class GraphFrame {
|
|
|
}
|
|
|
|
|
|
public dispose() {
|
|
|
- this.isCollapsed = false;
|
|
|
-
|
|
|
- this._nodes.forEach(node => {
|
|
|
- node.enclosingFrameId = -1;
|
|
|
- });
|
|
|
+ if(this.isCollapsed) {
|
|
|
+ while(this._nodes.length > 0) {
|
|
|
+ this._nodes[0].dispose();
|
|
|
+ }
|
|
|
+ this.isCollapsed = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._nodes.forEach(node => {
|
|
|
+ node.enclosingFrameId = -1;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
if (this._onSelectionChangedObserver) {
|
|
|
this._ownerCanvas.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
|