Repository navigation
gpui: release measured layout contexts before clearing Taffy - #9
Closed
liuyanghejerry wants to merge 1 commit into
Closed
liuyanghejerry wants to merge 1 commit into
liuyanghejerry wants to merge 1 commit into
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.
GPUI pins Taffy 0.13, whose
clear()leavesnode_context_dataalive. After a measured subtree disappears, its measurement closure can retain a view entity indefinitely. A repeated native input mount/unmount test reproduces this withApp::leak_detector_snapshot()/assert_no_new_leaks().Track measured node IDs and remove their contexts through
TaffyTree::set_node_context(id, None)before clearing the tree. This preserves Taffy's reusable tree allocations and keeps the fix in GPUI, where the measurement contexts are owned. The regression test checks captured values are dropped across shrinking frames.Taffy's fix is already merged in DioxusLabs/taffy#1181, but it belongs to 0.14; the current GPUI dependency is still exactly 0.13.0. Remove this compatibility patch once the dependency includes that fix.
Validation on macOS arm64:
clear_releases_measured_contextspasses in release. The temporary test workspace includes GPUI and its dependency closure (unrelated Zed CLI dependencies require uncached Wasmtime); sources and manifests are restored after the test.cargo check --all-targets --releasepass; 345 native unit tests pass.TextEditorStateentities.GPUIV temporarily consumes this single reachable commit from its own fork, with the divergence and removal triggers recorded in GPUIV PR #158.