summaryrefslogtreecommitdiffstats
path: root/generic/tkTextWind.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-01-23 15:13:33 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-01-23 15:13:33 (GMT)
commitf6ae7b10daac30df9b4e449f9f4d938bec208cdb (patch)
tree71e791114f8190d21dc28b9253a470a53550cd22 /generic/tkTextWind.c
parent71e4dd05509ede321087862d29a20a03b2eb9d4c (diff)
downloadtk-f6ae7b10daac30df9b4e449f9f4d938bec208cdb.zip
tk-f6ae7b10daac30df9b4e449f9f4d938bec208cdb.tar.gz
tk-f6ae7b10daac30df9b4e449f9f4d938bec208cdb.tar.bz2
Fix the first part of [1501749fff]. Now textWind-18.1 passes.
Diffstat (limited to 'generic/tkTextWind.c')
-rw-r--r--generic/tkTextWind.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index bd15cc9..c1278bf 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -1143,13 +1143,16 @@ TkTextEmbWinDisplayProc(
/*
* Mark the window as displayed so that it won't get unmapped.
- * <TODO>: Tk_MaintainGeometry/Tk_MapWindow may run event handlers,
- * in particular for the <Map> event. If the bound script
- * deletes the embedded window or the text widget we will
- * soon crash.
+ * Warning: Tk_MaintainGeometry/Tk_MapWindow may run event handlers,
+ * in particular for the <Map> event. If a bound script deletes the
+ * embedded window, then its client is gone and we would soon crash.
+ * Prevent this by getting the client again.
*/
- client->displayed = 1;
+ client = EmbWinGetClient(textPtr, ewPtr);
+ if (client != NULL) {
+ client->displayed = 1;
+ }
}
/*