Repository navigation
Release the type library reference returned when importing a library type or object - #8636
Merged
Merged
Conversation
…type or object `BNBinaryViewImportTypeLibraryType` and `BNBinaryViewImportTypeLibraryObject` store a new reference to the library the type or object came from in their `lib` out-parameter. The Python and Rust wrappers never released it, so every import leaked a reference to a type library. The Python wrappers also pointed the out-parameter at the caller's own handle, which let core write into the caller's `TypeLibrary`. Now both bindings pass a separate out-parameter and release what core returns. The C++ API already handled this correctly.
fuzyll
approved these changes
Oct 9, 2026
fuzyll
left a comment
Contributor
There was a problem hiding this comment.
Good catch. This looks good to me. Thanks!
bdash
force-pushed
the
test_typelib_import_ref_leak
branch
from
October 10, 2026 00:50
a6a77b2 to
38eac6c
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.
BNBinaryViewImportTypeLibraryTypeandBNBinaryViewImportTypeLibraryObjectstore a new reference to the library the type or object came from in theirlibout-parameter. The Python and Rust wrappers never released it, so every import leaked a reference to a type library. The Python wrappers also pointed the out-parameter at the caller's own handle, which let core write into the caller'sTypeLibrary.Now both bindings pass a separate out-parameter and release what core returns. The C++ API already handled this correctly.