dispose method

  1. @override
  2. @mustCallSuper
void dispose()
override

Frees all allocators, then delegates to RaylibModule.dispose.

Implementation

@override
@mustCallSuper
void dispose() {
  super.dispose();

  debugFreeInfo('Freeing built-in ${_builtInScalarAllocators.length + 2} scalar allocators...');
  String$.dispose();
  _pointerAllocator.dispose();
  _builtInScalarAllocators.values.forEach((a) => a.dispose());

  debugFreeInfo('Freeing built-in ${_builtInStructAllocators.length} struct allocators...');
  _builtInStructAllocators.values.forEach((a) => a.dispose());

  if (_customStructAllocators.isNotEmpty) {
    debugFreeInfo('Freeing ${_customStructAllocators.length} custom struct allocators...');
    _customStructAllocators.values.forEach((a) => a.dispose());
  }
}