Skip to content

Commit 70c7732

Browse files
committed
When shutting down a Matter World it will now call MatterEvents.off, clearing all events, and also removeAllListeners for any local events.
1 parent 011e67d commit 70c7732

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
* List.addMultiple has been removed. Used `List.add` instead which offers the exact same functionality.
109109
* List is now internally using all of the new Utils.Array functions.
110110
* Rectangle.Union will now cache all vars internally so you can use one of the input rectangles as the output rectangle without corrupting it.
111+
* When shutting down a Matter World it will now call MatterEvents.off, clearing all events, and also `removeAllListeners` for any local events.
111112

112113
### Animation System Updates
113114

src/physics/matter-js/World.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ var World = new Class({
894894
*/
895895
shutdown: function ()
896896
{
897+
MatterEvents.off();
898+
899+
this.removeAllListeners();
900+
897901
MatterWorld.clear(this.localWorld, false);
898902

899903
Engine.clear(this.engine);

0 commit comments

Comments
 (0)