dispose method

void dispose()

Release any resources held by this pipeline owner.

Prior to calling this method the pipeline owner must be removed from the pipeline owner tree, i.e. it must have neither a parent nor any children (see dropChild). It also must be detached from any PipelineManifold.

The object is no longer usable after calling dispose.

Implementation

void dispose() {
  assert(_children.isEmpty);
  assert(rootNode == null);
  assert(_manifold == null);
  assert(_debugParent == null);
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectDisposed(object: this);
  }
  _semanticsOwner?.dispose();
  _semanticsOwner = null;
  _nodesNeedingLayout.clear();
  _nodesNeedingCompositingBitsUpdate.clear();
  _nodesNeedingPaint.clear();
  _nodesNeedingSemantics.clear();
}