onDispose method

void onDispose(
  1. dynamic func(
    1. Texture texture
    )
)

Registers a callback function to be executed when the texture is disposed (i.e., its reference count reaches zero and the WebGL texture is deleted).

  • func: The function to call, receiving the disposed Texture as an argument.

Implementation

void onDispose(Function(Texture texture) func) {
  _onDispose.add(func);
}