Repository navigation
fix: stop the WaitFor timer when the first check passes before it is … - #1956
Merged
Merged
Conversation
xaviergxf
force-pushed
the
fix/waitfor-timer-leak
branch
3 times, most recently
from
October 23, 2026 14:36
b93370f to
f80e973
Compare
…started When a WaitFor* check passes synchronously, the helper disposes itself from inside the constructor, while the timer field is still null. The constructor then looks at WaitTask.IsCompleted to decide whether to start the timer, but WaitTask is a WhenAny(...).Unwrap() that completes on the thread pool, so it usually still reads as not completed at that point and the timer is started anyway. The later Dispose() from the using block returns early because the helper is already disposed, and nothing ever stops the timer. The timer's state is the helper, so until the timeout elapses it roots the helper, the rendered component, the renderer and everything the renderer holds. With bUnit's default timeout of one second that goes unnoticed. With a long DefaultWaitTimeout, a test suite keeps every page it rendered in memory for its whole run. The constructor now also checks isDisposed before starting the timer, and disposes the timer right after creating it if the check disposed the helper in between. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
linkdotnet
force-pushed
the
fix/waitfor-timer-leak
branch
from
October 25, 2026 15:57
f80e973 to
353126e
Compare
Collaborator
|
Absolustely valid and much appreciated. I took the liberty of rebasing your branch to the current That said, let's get that in and make a new release! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a memory leak that this PR fixes.