Repository navigation
fix(capture): drain native temporaries while Annotate records - #2980
Merged
Merged
Conversation
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.
Drain macOS temporary objects while Annotate records.
Reported symptom: Annotate runs out of memory or crashes after a few minutes of recording. This fixes missing autorelease pools found in its Rust capture workers; the full recording crash has not been reproduced here.
Before
crates/capture/src/capture/macos.rsran screenshot conversion, prompt checks, and ScreenCaptureKit filter refreshes without a per-tick pool.window_log.rspooled snapshots but not its frequent cursor/frontmost-app polls. The HID poller and Accessibility lookup worker also lacked per-iteration pools.After
Verified
The new macOS regression test failed before the worker pool was added and passes with it, without screen or Accessibility permissions. 514 related tests passed.
Read:
run_samplerincrates/capture/src/capture/macos.rs: early skips return from the pool closure, then park once, preserving the sampling schedule. Most changed lines are indentation.Checks run
python3 scripts/code-shape.py --check: passed.cargo fmt --all --check: passed via the check script.cargo clippy --locked -p scrawl-capture -p capture-core --all-targets -- -D warnings: passed.scripts/check capture window_log ax:: handoff::: passed.cargo nextest run --locked -p scrawl-capture -E 'test(the_prober_drains_autoreleased_objects_between_lookups)': failed before the fix, as intended; the test passed in the check run above.