Repository navigation
[memory-leak] Generalize disposed-field ownership guidance - #4994
Conversation
Co-authored-by: Copilot App <[email protected]>
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4994PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4994"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4994/packages --name skiasharp-pr-4994More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4994 |
📊 SkiaSharp benchmarks — PR #4994⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 21 slower · 🟢 29 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Description
Generalize memory-leak-fixer focus-area 8 from historical disposal fixes #1256 and #1344.
PR #1256 established that a disposed cached field must be nulled so later access cannot reuse a dead wrapper. PR #1344 established that cleanup order depends on ownership across managed/native object pairs: reference-only children may require managed cleanup before native teardown, while native-owned managed dependencies can remain live until native teardown finishes.
Focus 8 now expresses the general rule derived from those cases:
The example remains generalized and explicitly does not classify every similarly shaped wrapper as defective. One-leak-per-run, empirical-proof, and open-item deduplication gates remain unchanged.
Related issues
Context: #1256
Context: #1344
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
None — agent guidance only; no public API or runtime behavior changes.
Testing
WeakReferenceprobe and in-repository red→green validation. This confirms the revised guidance directs Terra to the intended analysis without broadening it into a claim about every similarly shaped wrapper.git diff --checkpassed.No workflow source changed, so lock recompilation was not required.
Checklist
Changesabove lists all public API and behavioral changes (or "None.")mono/skiaPR linked above and bindings regenerated (not applicable)