Skip to content

[mypyc] Fix function wrapper memory leak#21654

Merged
p-sawicki merged 3 commits into
python:masterfrom
p-sawicki:fix-function-wrapper-memory-leak
Jun 29, 2026
Merged

[mypyc] Fix function wrapper memory leak#21654
p-sawicki merged 3 commits into
python:masterfrom
p-sawicki:fix-function-wrapper-memory-leak

Conversation

@p-sawicki

Copy link
Copy Markdown
Collaborator

The name and code variables passed to the function wrapper init function are increfed inside it before storing them in the function wrapper object but they are not decrefed after the init function returns which creates a leak.

Change the init function to instead steal name and code and document it.

@p-sawicki p-sawicki merged commit 5374fec into python:master Jun 29, 2026
18 checks passed
@p-sawicki p-sawicki deleted the fix-function-wrapper-memory-leak branch June 29, 2026 15:31
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.

2 participants