|
|
@@ -2171,25 +2171,29 @@ class Renderer {
|
|
|
*/
|
|
|
dispose() {
|
|
|
|
|
|
- this.info.dispose();
|
|
|
- this.backend.dispose();
|
|
|
+ if ( this._initialized === true ) {
|
|
|
|
|
|
- this._animation.dispose();
|
|
|
- this._objects.dispose();
|
|
|
- this._pipelines.dispose();
|
|
|
- this._nodes.dispose();
|
|
|
- this._bindings.dispose();
|
|
|
- this._renderLists.dispose();
|
|
|
- this._renderContexts.dispose();
|
|
|
- this._textures.dispose();
|
|
|
+ this.info.dispose();
|
|
|
+ this.backend.dispose();
|
|
|
|
|
|
- if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
|
|
|
+ this._animation.dispose();
|
|
|
+ this._objects.dispose();
|
|
|
+ this._pipelines.dispose();
|
|
|
+ this._nodes.dispose();
|
|
|
+ this._bindings.dispose();
|
|
|
+ this._renderLists.dispose();
|
|
|
+ this._renderContexts.dispose();
|
|
|
+ this._textures.dispose();
|
|
|
|
|
|
- Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
|
|
|
+ if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
|
|
|
|
|
|
- if ( queryPool !== null ) queryPool.dispose();
|
|
|
+ Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
|
|
|
|
|
|
- } );
|
|
|
+ if ( queryPool !== null ) queryPool.dispose();
|
|
|
+
|
|
|
+ } );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
this.setRenderTarget( null );
|
|
|
this.setAnimationLoop( null );
|