Fix reference leaks in parser logger callback - #485
Merged
ObserverOfTime merged 1 commit intoAug 2, 2026
Conversation
Contributor
Author
|
Ran the full test suite locally using pytest tests/ all 60 tests pass. Also checked out master without my change and the failing tests pass there too on my machine(Python 3.14, Fedora), appears to be platform specific and unrelated to this diff. |
This was referenced Jul 23, 2026
Member
|
The test issue is fixed. Please rebase. |
log_callback() leaked both the LogType enum object and the Python callback's return value. Both are now properly released. Fixes tree-sitter#482
A-S-Manoj
force-pushed
the
fix/482-log-callback-refleak
branch
from
July 28, 2026 13:43
e0db811 to
6911ec2
Compare
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.
log_callback()intree_sitter/binding/parser.cleaked both theLogTypeenum object returned by the enum constructor and the returnvalue of the Python logger callback. Neither reference was released.
This adds a NULL check on the enum construction and properly
decrefs both the enum and the callback result.
Fixes #482