uxebu / bonsai

BonsaiJS is a graphics library and renderer
http://bonsaijs.org
Other
1.96k stars 189 forks source link

Stage.destroy() does not remove the window's resize event listeners. #212

Open lmeurs opened 11 years ago

lmeurs commented 11 years ago

After destroying a Bonsaijs instance and then resizing the window, errors are thrown. Firefox outputs:

TypeError: this.renderer is undefined

...s._sendEnvData);window.addEventListener("resize",a,!1);window.addEventListener("...

Chrome says:

Uncaught TypeError: Cannot call method 'getOffset' of undefined bonsai.min.js:219
we._sendEnvData bonsai.min.js:219
(anonymous function)

See http://jsfiddle.net/RfsUn/.