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 leaks in Python wrapper by adding missing Py_DECREF. #1754

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

KerstinKeller
Copy link
Contributor

Description

When writing Python extensions from C++, objects created with Py_BuildValue, Py_.... need their references decremented unless they are returned directly from the functions.
This PR fixes some occurences where the ref counters where not decreased, which leads to memory leaks.

Related issues

Fixes #1753

@KerstinKeller KerstinKeller added bug Something isn't working cherry-pick-to-support/v5.12 Cherry pick these changes to support/v.5.12 cherry-pick-to-support/v5.13 Cherry pick these changes to support/v5.13 labels Oct 1, 2024
Copy link
Contributor

@hannemn hannemn left a comment

Choose a reason for hiding this comment

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

Beautiful! :-D

@KerstinKeller KerstinKeller merged commit 60f7835 into master Oct 1, 2024
25 of 26 checks passed
KerstinKeller added a commit that referenced this pull request Oct 2, 2024
…EF. (#1754) (#1758)

Co-authored-by: KerstinKeller <KerstinKeller@users.noreply.github.com>
KerstinKeller added a commit that referenced this pull request Oct 2, 2024
…EF. (#1754) (#1759)

Co-authored-by: KerstinKeller <KerstinKeller@users.noreply.github.com>
@KerstinKeller KerstinKeller deleted the hotfix/memory-leak-python-monitoring branch October 2, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cherry-pick-to-support/v5.12 Cherry pick these changes to support/v.5.12 cherry-pick-to-support/v5.13 Cherry pick these changes to support/v5.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants