flagLeak method

  1. @mustCallSuper
  2. @override
void flagLeak ([String description ])

Flag the object as having been disposed in a way that allows easier profiling.

The leak flag is only set after disposal, so most instances found in a heap snapshot will indicate memory leaks.

Consumers can search a heap snapshot for the LeakFlag class to see all instances of the flag.


void flagLeak([String description]) {
  if (_debugMode && _leakFlag == null) {
    _leakFlag = new LeakFlag(description ?? runtimeType.toString());