Commit 8ed1f79
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 4fa86ca commit 8ed1f79
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 | | |
| |||
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
350 | 362 | | |
351 | 363 | | |
352 | 364 | | |
| |||
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 | |
|---|---|---|---|
| |||
2431 | 2431 | | |
2432 | 2432 | | |
2433 | 2433 | | |
2434 | | - | |
| 2434 | + | |
2435 | 2435 | | |
2436 | 2436 | | |
2437 | 2437 | | |
| |||
2500 | 2500 | | |
2501 | 2501 | | |
2502 | 2502 | | |
2503 | | - | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2504 | 2506 | | |
2505 | 2507 | | |
2506 | 2508 | | |
| |||
2533 | 2535 | | |
2534 | 2536 | | |
2535 | 2537 | | |
| 2538 | + | |
2536 | 2539 | | |
2537 | 2540 | | |
2538 | 2541 | | |
| |||
0 commit comments