xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
715 stars 286 forks source link

Small bug in destructor of Input.js #105

Closed tmarti closed 5 years ago

tmarti commented 5 years ago

In those lines of code belonging to src/viewer/scene/Input.js destructor...

https://github.com/xeokit/xeokit-sdk/blob/1a8b425ad4d5fbe996ba1ffe97f332ae29f41f84/src/viewer/scene/input/Input.js#L2221-L2223

... shouldn't it be...

window.removeEventListener("deviceorientation", this._deviceOrientListener);

... instead of...

window.addEventListener("deviceorientation", this._deviceOrientListener);

... as this is the object destructor?

xeolabs commented 5 years ago

Oh yes that's a bug. Could you make a PR?

tmarti commented 5 years ago

Sure! Just wait for next week

xeolabs commented 5 years ago

Fixed in https://github.com/xeokit/xeokit-sdk/commit/0914d69750c7274b3a068fa0f9951f7ce3818696