Skip to main content

Class: Disposer

components.Disposer

A class to safely remove meshes and geometries from memory to prevent memory leaks.

Methods

dispose

dispose(mesh, materials?, recursive?): void

Removes a mesh, its geometry and its materials from memory. If you are using any of these in other parts of the application, make sure that you remove them from the mesh before disposing it.

Parameters

NameTypeDefault valueDescription
meshItem3Dundefinedthe mesh to remove.
materialsbooleantruewhether to dispose the materials of the mesh.
recursivebooleantruewhether to recursively dispose the children of the mesh.

Returns

void

Defined in

temp/components/core/Disposer/index.ts:21


disposeGeometry

disposeGeometry(geometry): void

Disposes a geometry from memory.

Parameters

NameTypeDescription
geometryBufferGeometry<NormalBufferAttributes>the geometry to remove.

Returns

void

Defined in

temp/components/core/Disposer/index.ts:38