Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.15] gh-80937: Fix memory leak in tkinter createcommand (GH-152294) - #152327

#152327
Merged
serhiy-storchaka merged 1 commit into
python:3.15python/cpython:3.15from
miss-islington:backport-bbf7786-3.15miss-islington/cpython:backport-bbf7786-3.15Copy head branch name to clipboard
Jun 26, 2026
Merged

[3.15] gh-80937: Fix memory leak in tkinter createcommand (GH-152294)#152327
serhiy-storchaka merged 1 commit into
python:3.15python/cpython:3.15from
miss-islington:backport-bbf7786-3.15miss-islington/cpython:backport-bbf7786-3.15Copy head branch name to clipboard

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

A command created with createcommand() held a strong reference to the
interpreter, forming an uncollectable cycle (interpreter -> command ->
interpreter) that kept the interpreter and the callback alive until the
command was removed with deletecommand() or destroy(). The command now
borrows the reference; it cannot outlive the interpreter, which deletes its
commands when finalized.
(cherry picked from commit bbf7786)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

…2294)

A command created with createcommand() held a strong reference to the
interpreter, forming an uncollectable cycle (interpreter -> command ->
interpreter) that kept the interpreter and the callback alive until the
command was removed with deletecommand() or destroy().  The command now
borrows the reference; it cannot outlive the interpreter, which deletes its
commands when finalized.
(cherry picked from commit bbf7786)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) June 26, 2026 18:55
@serhiy-storchaka
serhiy-storchaka merged commit 2a3189c into python:3.15 Jun 26, 2026
55 checks passed
@miss-islington
miss-islington deleted the backport-bbf7786-3.15 branch June 26, 2026 19:22
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.