提交 5cf791f9 编写于 作者: P PaHae 提交者: Mr.doob

Add dispose function to VREffect. Otherwise it causes a memory leak if it is...

Add dispose function to VREffect. Otherwise it causes a memory leak if it is instantiated several times -> always add eventlistener on window (#9787)
上级 397fc187
......@@ -137,6 +137,10 @@ THREE.VREffect = function ( renderer, onError ) {
window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
this.dispose = function () {
window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
};
this.setFullScreen = function ( boolean ) {
return new Promise( function ( resolve, reject ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册