Back to Filament

destroy

docs/android/dokka/filament-android/com.google.android.filament/-engine/destroy.md

1.75.0778 B
Original Source

//filament-android/com.google.android.filament/Engine/destroy

destroy

[main]
open fun destroy()

Destroy the Engine instance and all associated resources.

This method is one of the few thread-safe methods.

destroy should be called last and after all other resources have been destroyed, it ensures all filament resources are freed.

Destroy performs the following tasks:

Destroy all internal software and hardware resources.Free all user allocated resources that are not already destroyed and logs a warning.

This indicates a "leak" in the user's code.

Terminate the rendering engine's thread.```kotlin Engine engine = Engine.create(); engine.destroy();