Skip to content

Commit a617df9

Browse files
yaustarSteven Yau
andauthored
Removes global data when Component System is destroyed (playcanvas#2448)
Fixes playcanvas#2442 Co-authored-by: Steven Yau <syau@snaphcat.com>
1 parent 0a22646 commit a617df9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/framework/components/system.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,14 @@ ComponentSystem.destroy = function () {
337337
ComponentSystem.off('animationUpdate');
338338
ComponentSystem.off('fixedUpdate');
339339
ComponentSystem.off('postUpdate');
340+
341+
ComponentSystem._init = [];
342+
ComponentSystem._postInit = [];
343+
ComponentSystem._toolsUpdate = [];
344+
ComponentSystem._update = [];
345+
ComponentSystem._animationUpdate = [];
346+
ComponentSystem._fixedUpdate = [];
347+
ComponentSystem._postUpdate = [];
340348
};
341349

342350
export { ComponentSystem };

0 commit comments

Comments
 (0)