destroy method

void destroy()

Implementation

void destroy() {
  componentState.add(TComponentStateItem.csDestroying);
  // First notifies objects registered via FreeNotification
  for (final c in List<TComponent>.from(_freeNotifies)) {
    c.notification(this, TOperation.opRemove);
  }
  _freeNotifies.clear();
  // Frees the components it owns itself
  while (_components.isNotEmpty) {
    _components.last.free();
  }
  _owner?._components.remove(this);
  _owner = null;
}