diff options
author | fvogel <fvogelnew1@free.fr> | 2015-09-23 19:47:25 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-09-23 19:47:25 (GMT) |
commit | 47199fd8879caa8830088266d33b6c9380348668 (patch) | |
tree | 30ada10cf1280aa22574e64a76d434a77cf3609c /generic | |
parent | cc8829c253eb7b3ecf6d07c9109924f28d592216 (diff) | |
download | tk-47199fd8879caa8830088266d33b6c9380348668.zip tk-47199fd8879caa8830088266d33b6c9380348668.tar.gz tk-47199fd8879caa8830088266d33b6c9380348668.tar.bz2 |
Fixed bug [1501749fff] - Crash on embedded window deletion bound to <Map> event
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextWind.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 8d1f850..5b511d2 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -1123,6 +1123,16 @@ TkTextEmbWinDisplayProc( &lineX, &windowY, &width, &height); windowX = lineX - chunkPtr->x + x; + /* + * Mark the window as displayed so that it won't get unmapped. + * This needs to be done before the next instruction block because + * Tk_MaintainGeometry/Tk_MapWindow will run event handlers, in + * particular for the <Map> event, and if the bound script deletes + * the embedded window its clients will get freed. + */ + + client->displayed = 1; + if (textPtr->tkwin == Tk_Parent(tkwin)) { if ((windowX != Tk_X(tkwin)) || (windowY != Tk_Y(tkwin)) || (Tk_ReqWidth(tkwin) != Tk_Width(tkwin)) @@ -1134,12 +1144,6 @@ TkTextEmbWinDisplayProc( Tk_MaintainGeometry(tkwin, textPtr->tkwin, windowX, windowY, width, height); } - - /* - * Mark the window as displayed so that it won't get unmapped. - */ - - client->displayed = 1; } /* |