Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove dead ClearStaticTracking superseded by DisposeAndCle…
…arStaticTrackingAsync
  • Loading branch information
thomhurst committed Jun 3, 2026
commit 1d0b0a363e196681401977be7b67fab22a99226e
12 changes: 2 additions & 10 deletions TUnit.Core/Tracking/ObjectTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace TUnit.Core.Tracking;
/// </summary>
/// <remarks>
/// The static <c>s_trackedObjects</c> dictionary is shared across all tests.
/// Call <see cref="ClearStaticTracking"/> at the end of a test session to release memory.
/// Call <see cref="DisposeAndClearStaticTrackingAsync"/> at the end of a run session to
/// dispose any leftovers and release memory.
/// </remarks>
internal class ObjectTracker(TrackableObjectGraphProvider trackableObjectGraphProvider, Disposer disposer)
{
Expand All @@ -27,15 +28,6 @@ internal class ObjectTracker(TrackableObjectGraphProvider trackableObjectGraphPr
/// </summary>
public static IReadOnlyCollection<Exception> GetAsyncCallbackErrors() => s_asyncCallbackErrors.ToArray();

/// <summary>
/// Clears all static tracking state. Call at the end of a test session to release memory.
/// </summary>
public static void ClearStaticTracking()
{
s_trackedObjects.Clear();
s_asyncCallbackErrors.Clear();
}

/// <summary>
/// Disposes any objects still tracked with a positive reference count, then clears all
/// static tracking state. Call at the end of a run session: every executed test has
Expand Down
Loading