dispose method

void dispose()

Release this handle's claim on the underlying Image. This handle is no longer usable after this method is called.

Once all outstanding handles have been disposed, the underlying image will be disposed as well.

In debug mode, debugGetOpenHandleStackTraces will return a list of StackTrace objects from all open handles' creation points. This is useful when trying to determine what parts of the program are keeping an image resident in memory.


void dispose() {
  assert(!_disposed && !_image._disposed);
  _disposed = true;
  final bool removed = _image._handles.remove(this);
  if (_image._handles.isEmpty) {