You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6f4818c
Browse filesBrowse the repository at this point in the historyBrowse files
extractor: recognize field disposal via a receiver-consuming helper
A field released through a 'drain and dispose' sink — a first-party extension
method that disposes its receiver, like NLog's WaitForDispose(this Timer,
TimeSpan) — was reported as an OWN001 owned-field leak, because the disposal
scan only keys on a literal .Dispose()/.Close()/.DisposeAsync() on the field.
Credit field.M(...) as a release when M is a first-party extension method whose
receiver it disposes. CallReleasesReceiver reuses the existing ConsumesParam on
the reduced extension method's receiver parameter, so the release is proved by
inspecting M's real body (following first-party forwarding, cycle-guarded,
IDisposable-only) — never guessed from the name. Scope is extension methods
only; an instance method disposing its own 'this' is left out.
Clears the NLog timer FPs where the sink is called on the field directly or
through a 'var t = _field;' alias (AsyncTaskTarget, AsyncTargetWrapper,
BufferingTargetWrapper). TimeoutContinuation, which disposes the result of
Interlocked.Exchange(ref _timer, null), stays baselined until ref-exchange
alias tracking lands.
New corpus fixture field-dispose-via-helper proves it: before.cs leaks the
Timer field (OWN001 caught), after.cs releases it via the sink and must be
silent — the benchmark's after-clean gate is the end-to-end check.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019846YSZ35c7CdkWQ1qX5gm
0 commit comments