Skip to main content

Disposer

A tool to safely remove meshes, geometries, materials and other items from memory to prevent memory leaks.

Extends

Properties

enabled

enabled: boolean = true

Component.enabled

Overrides

Component . enabled


uuid

static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe"

A unique identifier for the component. This UUID is used to register the component within the Components system.

Methods

destroy()

destroy(object, 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

ParameterTypeDefault valueDescription
objectObject3D<Object3DEventMap>undefinedthe object
to remove.
materialsbooleantruewhether to dispose the materials of the mesh.
recursivebooleantruewhether to recursively dispose the children of the mesh.

Returns

void


disposeGeometry()

disposeGeometry(geometry): void

Disposes a geometry from memory.

Parameters

ParameterTypeDescription
geometryBufferGeometry<NormalBufferAttributes>

the

geometry

to remove.

Returns

void


get()

get(): Set<string>

Return the UUIDs of all disposed components.

Returns

Set<string>


isConfigurable()

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns

this is Configurable<any, any>

Inherited from

Component . isConfigurable


isDisposeable()

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

Component . isDisposeable


isHideable()

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

Component . isHideable


isResizeable()

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

Component . isResizeable


isUpdateable()

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

Component . isUpdateable