summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-05-07 18:32:29 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-05-07 18:32:29 (GMT)
commit0115b442d416799d1774ca0b8487f5d66f85d067 (patch)
tree50ebab128ec74c038268431117fb02f5b6aa0cfc /library/tk.tcl
parentc00403e250ff3f9d217f19bbc0198f6800102970 (diff)
downloadtk-0115b442d416799d1774ca0b8487f5d66f85d067.zip
tk-0115b442d416799d1774ca0b8487f5d66f85d067.tar.gz
tk-0115b442d416799d1774ca0b8487f5d66f85d067.tar.bz2
Fix [3414695fff]: tk_getOpenFile, tk_getSaveFile, tk_chooseDir: error when parent destroyed first.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r--library/tk.tcl10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index 89267d6..e00f073 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -178,10 +178,12 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
catch {focus $oldFocus}
grab release $grab
- if {$destroy eq "withdraw"} {
- wm withdraw $grab
- } else {
- destroy $grab
+ if {[winfo exists $grab]} {
+ if {$destroy eq "withdraw"} {
+ wm withdraw $grab
+ } else {
+ destroy $grab
+ }
}
if {[winfo exists $oldGrab] && [winfo ismapped $oldGrab]} {
if {$oldStatus eq "global"} {