| Ticket UUID: | bd352828bbea701a34e99e113de2998272c849fa | |||
| Title: | Windows: clipboard clear crashes before the main window exists | |||
| Type: | Bug | Version: | 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | serhiy.storchaka | Created on: | 2026-10-09 15:05:12 | |
| Subsystem: | 52. [clipboard] | Assigned To: | aku | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2026-10-16 18:35:59 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2026-10-16 18:35:59 | |||
| Description: |
On Windows, clipboard clear crashes wish (access violation) when its window (the -displayof one, or ".") has not been made yet: as the first command of a script, after wm withdraw ., or for a widget not yet packed or a new toplevel before update: clipboard clear puts ok update button .b clipboard clear -displayof .b Other clipboard and selection commands (clipboard append, also with such a -displayof window, clipboard get, selection own) do not crash. The clear subcommand calls TkSelUpdateClipboard() with the -displayof window ("." by default), and on Windows that takes TkWinGetHWND(winPtr->window) of it: a NULL Window while the window has not been made yet. Tk_ClipboardAppend() passes dispPtr->clipWindow instead, which TkClipInit() has made exist. Found while running Tktaalik tests on Windows. | |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-10-16 18:35:59:
Merged into main, core-9-0-branch, and core-8-6-branch by commits [0d74f846] (Jan), [0a2669d1], and [ceabff3d]. Closing the ticket. serhiy.storchaka added on 2026-10-09 16:21:40: Proposed fix in branch win-clipboard-clear-unmade: clipboard clear updates the Windows clipboard with the clipboard window, as clipboard append does, instead of the -displayof window. Test clipboard-7.21 crashes without the fix and passes with it on Windows 11. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki