← 输入框|github.com|刷新
Skip to content

Release linked sketch caches during UI cleanup - #1817

Merged
phkahler merged 1 commit into
solvespace:masterfrom
alken1t15:fix/linked-sketch-leak
Nov 12, 2026
Merged

phkahler merged 1 commit into
solvespace:masterfrom
alken1t15:fix/linked-sketch-leak

Conversation

@alken1t15

Copy link
Copy Markdown
Contributor

SolveSpaceUI::Clear() leaves the linked-sketch caches populated. Their cached Sketch objects are owned through raw pointers and need the explicit cleanup already provided by ClearLinkedSketches(). If a linked-file test runs last, shutdown leaks those objects and their allocations. Starting another sketch clears the caches, which makes the failure depend on the shuffled test order.

Call ClearLinkedSketches() during UI cleanup, covering application/CLI shutdown and test teardown.

This addresses the Ubuntu sanitizer failure reported in #1813. group/link/normal_roundtrip alone reproduces the same 45,428-byte leak in 17 allocations on master abf33ac. It also reproduces with the two helix files restored to their pre-#1813 versions from b34d744, so the leak predates that PR.

Tested in a Debug headless build with GCC 11.4, ENABLE_SANITIZERS=ON, ENABLE_OPENMP=ON, leak detection enabled and three OpenMP threads. The isolated reproducer and all 300 tests (1,246 checks) pass without sanitizer errors after the fix. The full suite used seed 2062209549 from the failing CI run; before the fix it reproduces the same leak. No interactive GUI testing was performed.

@alken1t15

Copy link
Copy Markdown
Contributor Author

@phkahler @ruevs Could you review this cleanup fix when you have a chance? It addresses the sanitizer leak reported in #1813. The isolated reproducer and the full 300-test suite pass locally with leak detection and OpenMP enabled after the change.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the linked-sketch cache cleanup change.

No open issues 🎉

What changed in this PR

Releases linked-sketch caches during UI cleanup to address the order-dependent shutdown leak reported in #1813.

Changes:

  • Calls ClearLinkedSketches() from SolveSpaceUI::Clear(), covering application/CLI shutdown and test teardown.
File Description
src/​solvespace.cpp Adds explicit linked-sketch cache cleanup to SolveSpaceUI::Clear().

Review effort: Balanced

@phkahler
phkahler merged commit e56db0d into solvespace:master Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants