From dceb6487b9e195d99e186db8c19889c67632e7dd Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 23 Aug 2012 21:40:24 +0000 Subject: 3554026,3561016 Stop crash with tearoff menus. --- ChangeLog | 4 ++++ unix/tkUnixWm.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 52d9739..d540456 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-08-23 Don Porter + + * unix/tkUnixWm.c: [Bugs 3554026,3561016] Stop crash with tearoff menus. + 2012-08-17 Jan Nijtmans * win/nmakehlp.c: Add "-V" option, in order to be able diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index cb5b643..fa130a1 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -6276,6 +6276,13 @@ TkSetTransientFor(tkwin, parent) while (!Tk_IsTopLevel(parent)) parent = Tk_Parent(tkwin); } + /* + * Prevent crash due to incomplete initialization, or other problems. + * [Bugs 3554026, 3561016] + */ + if (((TkWindow *)parent)->wmInfoPtr->wrapperPtr == NULL) { + return; + } XSetTransientForHint(Tk_Display(tkwin), ((TkWindow *)tkwin)->wmInfoPtr->wrapperPtr->window, ((TkWindow *)parent)->wmInfoPtr->wrapperPtr->window); -- cgit v0.12