schteppe / p2.js

JavaScript 2D physics library
Other
2.63k stars 330 forks source link

EventEmitter bug fix #336

Open Fxlr8 opened 5 years ago

Fxlr8 commented 5 years ago

this.tmpArray was not cleaned after every event emission. This caused listeners to leak to the events they don't belong to and crash the app.

By the way, do we really need to store tmpArray globally (this.tmpArray)? Maybe just create an empty local tmpArray every time?