maybeTearDownLeakTrackingForTest function

void maybeTearDownLeakTrackingForTest()

If leak tracking is enabled, stops it and declares notDisposed objects as leaks.

Implementation

void maybeTearDownLeakTrackingForTest() {
  if (!LeakTesting.enabled ||
      !LeakTracking.isStarted ||
      LeakTracking.phase.ignoreLeaks) return;
  LeakTracking.phase = const PhaseSettings.ignored();
}