summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2012-08-23 21:40:24 (GMT)
committerdgp@users.sourceforge.net <dgp>2012-08-23 21:40:24 (GMT)
commitbd06c93840ac4e4491ac7c8884c3d82d59501332 (patch)
treeb19816dc407b206d638671323e89336484bb8e41 /unix
parentd5cd849a37bbbf8d275c54110e41c1505b4af472 (diff)
downloadtk-bd06c93840ac4e4491ac7c8884c3d82d59501332.zip
tk-bd06c93840ac4e4491ac7c8884c3d82d59501332.tar.gz
tk-bd06c93840ac4e4491ac7c8884c3d82d59501332.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 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);