Skip to content

Commit 438eca6

Browse files
authored
Merge pull request #14809 from aardgoose/anaglyph-dispose
dispose of all objects, not just the render targets in AnaglyphEffect.js
2 parents 29df373 + 64333be commit 438eca6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/js/effects/AnaglyphEffect.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
114114

115115
} );
116116

117-
var mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), _material );
118-
_scene.add( mesh );
117+
var _mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), _material );
118+
_scene.add( _mesh );
119119

120120
this.setSize = function ( width, height ) {
121121

@@ -142,10 +142,12 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
142142

143143
};
144144

145-
this.dispose = function() {
145+
this.dispose = function () {
146146

147147
if ( _renderTargetL ) _renderTargetL.dispose();
148148
if ( _renderTargetR ) _renderTargetR.dispose();
149+
if ( _mesh ) _mesh.geometry.dispose();
150+
if ( _material ) _material.dispose();
149151

150152
};
151153

0 commit comments

Comments
 (0)