Commit 2a1d898
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>
1 parent 668860b commit 2a1d898
3 files changed
Lines changed: 21 additions & 2 deletions
File tree
- Lib/test/test_tkinter
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
333 | 334 | | |
334 | 335 | | |
335 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
336 | 348 | | |
337 | 349 | | |
338 | 350 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2406 | 2406 | | |
2407 | 2407 | | |
2408 | 2408 | | |
2409 | | - | |
| 2409 | + | |
2410 | 2410 | | |
2411 | 2411 | | |
2412 | 2412 | | |
| |||
2475 | 2475 | | |
2476 | 2476 | | |
2477 | 2477 | | |
2478 | | - | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
2479 | 2481 | | |
2480 | 2482 | | |
2481 | 2483 | | |
| |||
2506 | 2508 | | |
2507 | 2509 | | |
2508 | 2510 | | |
| 2511 | + | |
2509 | 2512 | | |
2510 | 2513 | | |
2511 | 2514 | | |
| |||
0 commit comments