Skip to content

Fix: CFTree retains and releases its context info - #148

Open
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:fix-cftree-context-lifecycle
Open

Fix: CFTree retains and releases its context info#148
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:fix-cftree-context-lifecycle

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CFTreeCreate copied the context but never called its retain callback, and CFTreeFinalize passed the tree itself to the release callback instead of the context info. A tree created with a retaining context therefore released the wrong object on finalization, double-freeing the tree, and never retained or released its info.

CFTreeCreate now retains the info through the context retain callback, and CFTreeFinalize releases the info. This is the behaviour CFXMLTreeCreateWithNode relies on.

The test context.m fails before this change (it aborts when the tree is released) and passes after. Verified against Apple CoreFoundation.

@DTW-Thalion
DTW-Thalion force-pushed the fix-cftree-context-lifecycle branch from 570839f to 7188a51 Compare July 24, 2026 15:22
@DTW-Thalion DTW-Thalion reopened this Jul 24, 2026
@DTW-Thalion DTW-Thalion reopened this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant