Repository navigation
Keep an IPC's worklet alive for as long as the IPC - #107
Merged
Merged
Conversation
Both bindings took a worklet, reached into it, and then dropped the reference, so an IPC could outlive the worklet it was opened on with ARC or the collector deciding the order. Hold it in each, which orders the teardown the way the objects are actually related.
kasperisager
previously approved these changes
Aug 14, 2026
The first cut assigned the ivar and called it ownership, but this file is manual reference counting: the assignment held nothing, so an IPC could still outlive its worklet. Retain it, release it in dealloc, and assert the reference exists - the test fails on the assignment-only version.
kasperisager
approved these changes
Aug 14, 2026
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.
Both bindings take a worklet in the constructor, reach into it, and drop the reference. So a BareIPC or a Java IPC can outlive the worklet it was opened on, with ARC or the collector picking the order.
Twelve lines to hold it in each, which makes the object graph say what is already true: an IPC without its worklet is meaningless.
Harmless on its own today. It becomes load-bearing with #106, where the queue belongs to the worklet and the host must retire its ipc first. Split out of #94.