wgge 2.0.14 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -113,11 +113,16 @@ export default class ObjectModel extends ModelBase {
|
|
|
113
113
|
/**
|
|
114
114
|
* Use this to release all event handlers that might be registered.
|
|
115
115
|
* Object won't be usable after calling this.
|
|
116
|
-
* Not calling this might lead to memory leaks e.g. when using NullableNode
|
|
116
|
+
* Not calling this when object is meant to be destroyed might lead to memory leaks e.g. when using NullableNode
|
|
117
117
|
*/
|
|
118
118
|
dispose() {
|
|
119
|
-
this.
|
|
119
|
+
this.properties.forEach(
|
|
120
|
+
(prop) => {
|
|
121
|
+
if (typeof prop.dispose === 'function') prop.dispose();
|
|
122
|
+
}
|
|
123
|
+
);
|
|
120
124
|
this.properties.reset();
|
|
125
|
+
this.eventManager.reset();
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
}
|
|
@@ -2,6 +2,7 @@ import DirtyValue from "./DirtyValue";
|
|
|
2
2
|
import {EVENT_REMOVE_ME} from "../ModelBase";
|
|
3
3
|
|
|
4
4
|
export default class NullableNode extends DirtyValue {
|
|
5
|
+
|
|
5
6
|
nodeFactory;
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -64,4 +65,8 @@ export default class NullableNode extends DirtyValue {
|
|
|
64
65
|
}
|
|
65
66
|
return [];
|
|
66
67
|
}
|
|
68
|
+
|
|
69
|
+
dispose() {
|
|
70
|
+
this.set(null);
|
|
71
|
+
}
|
|
67
72
|
}
|