Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in PyTypeBuilder::build #3401

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

messense
Copy link
Member

Fixes #3400

@messense messense force-pushed the fix-issue-3400 branch 2 times, most recently from 00d3507 to bbe7b35 Compare August 18, 2023 12:31
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is only correct since Python 3.11:

https://docs.python.org/3/whatsnew/changelog.html#id144

So we'll need to decide to do this based on the Python version at runtime. For non-abi3 that's easy, we use cfg, for abi3 we need to detect sys.version_info - see bpo_35810_workaround in pyclass.rs for an example of how to do this.

src/pyclass/create_type_object.rs Outdated Show resolved Hide resolved
@messense
Copy link
Member Author

FYI, the C API changelog entry is a bit wrong, it's not bpo-29103, it's actually bpo-45315

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this looks good to me 👍

@davidhewitt davidhewitt added this pull request to the merge queue Aug 18, 2023
Merged via the queue into PyO3:main with commit 15388fd Aug 18, 2023
30 of 31 checks passed
@messense messense deleted the fix-issue-3400 branch October 12, 2023 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential memory leak in PyTypeBuilder::build
2 participants