diff options
author | fvogel <fvogelnew1@free.fr> | 2015-09-29 19:30:02 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-09-29 19:30:02 (GMT) |
commit | 83d57d8109be84e77eee65c34eb3cee62955fa64 (patch) | |
tree | 910ef88c566c1299a1f551bb25800423467b6352 /generic/tkTextWind.c | |
parent | 017890a01cb3ab922c132d955b56d67cffa99545 (diff) | |
parent | e7e95b939480e1862dd4c534da31c3cd75a3afae (diff) | |
download | tk-83d57d8109be84e77eee65c34eb3cee62955fa64.zip tk-83d57d8109be84e77eee65c34eb3cee62955fa64.tar.gz tk-83d57d8109be84e77eee65c34eb3cee62955fa64.tar.bz2 |
Fixed bug [1501749fff] - Crash on embedded window deletion bound to <Map> event
Diffstat (limited to 'generic/tkTextWind.c')
-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 bd61d75..c9fc20f 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -1134,6 +1134,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)) @@ -1145,12 +1155,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; } /* |