dispose method

void dispose()

Disposes all resources. The instance must not be used afterwards.

Implementation

void dispose() {
  stopRenderLoop();

  _scratchDepthArray = null;
  _persistentIndexArray = null;
  _splatTexScratch = null;

  _disposeGlResourcesForContext(_gl);

  try {
    _angle.dispose([_targetTexture]);
  } catch (e) {
    debugPrint('Warning: error disposing target texture: $e');
  }

  try {
    _depthSorter.dispose();
  } catch (e) {
    debugPrint('Warning: error disposing depth sorter: $e');
  }

  try {
    _perf?.dispose();
  } catch (e) {
    debugPrint('Warning: error disposing profiler: $e');
  }
}