checkNotGCed static method

Future<void> checkNotGCed()

Checks for new not-GCed leaks.

Invoke this method to detect the leaks earlier, when the leaked objects are not GCed yet, to obtain retaining path.

Implementation

static Future<void> checkNotGCed() async {
  Future<void>? result;

  assert(() {
    result = _leakTracker?.objectTracker.checkNotGCed();
    return true;
  }());

  await (result ?? Future<void>.value());
}