We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fce901 commit 7961810Copy full SHA for 7961810
examples/webgl_loader_svg.html
@@ -142,6 +142,10 @@
142
143
//
144
145
+ if ( scene ) disposeScene( scene );
146
+
147
+ //
148
149
scene = new THREE.Scene();
150
scene.background = new THREE.Color( 0xb0b0b0 );
151
@@ -250,6 +254,21 @@
250
254
251
255
}
252
256
257
+ function disposeScene( scene ) {
258
259
+ scene.traverse( function ( object ) {
260
261
+ if ( object.isMesh || object.isLine ) {
262
263
+ object.geometry.dispose();
264
+ object.material.dispose();
265
266
+ }
267
268
+ } );
269
270
271
253
272
</script>
273
274
</body>
0 commit comments