wgge 2.0.13 → 2.0.14

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.
@@ -5,7 +5,7 @@ import ModelBase from "./ModelBase";
5
5
  export default class ObjectModel extends ModelBase {
6
6
 
7
7
  /**
8
- * @type Dictionary<DirtyValue>
8
+ * @type {Dictionary<ModelBase>}
9
9
  */
10
10
  properties;
11
11
 
@@ -110,4 +110,14 @@ export default class ObjectModel extends ModelBase {
110
110
  return [];
111
111
  }
112
112
 
113
+ /**
114
+ * Use this to release all event handlers that might be registered.
115
+ * Object won't be usable after calling this.
116
+ * Not calling this might lead to memory leaks e.g. when using NullableNode
117
+ */
118
+ dispose() {
119
+ this.eventManager.reset();
120
+ this.properties.reset();
121
+ }
122
+
113
123
  }
@@ -39,4 +39,8 @@ export default class EventManager {
39
39
  handlers.forEach((item) => item(param));
40
40
  }
41
41
 
42
+ reset() {
43
+ this.handlers = [];
44
+ }
45
+
42
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "devDependencies": {