summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-08-23 21:41:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-08-23 21:41:43 (GMT)
commitc0a9fce973031291671d7ad72ec9a6e766125d6d (patch)
treef215e8243e70d863e37e62c90bc36ccd2d3730de /unix
parent05edd84341db5937d08bfde47f4497400e26a048 (diff)
parentdceb6487b9e195d99e186db8c19889c67632e7dd (diff)
downloadtk-c0a9fce973031291671d7ad72ec9a6e766125d6d.zip
tk-c0a9fce973031291671d7ad72ec9a6e766125d6d.tar.gz
tk-c0a9fce973031291671d7ad72ec9a6e766125d6d.tar.bz2
3554026,3561016 Stop crash with tearoff menus.
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixWm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 1d66412..c79f7cb 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -6755,6 +6755,13 @@ TkSetTransientFor(Tk_Window tkwin, Tk_Window 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);