summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2012-08-23 21:41:43 (GMT)
committerdgp@users.sourceforge.net <dgp>2012-08-23 21:41:43 (GMT)
commitb333a8a162e76e92baf521df6ffe9a88d9f0c618 (patch)
treef215e8243e70d863e37e62c90bc36ccd2d3730de
parent3154cdf2debe2506b23b92d7da2b202f4fe9a6f9 (diff)
parent3e84a653ed7faed7a14ea2557d23deb447b26607 (diff)
downloadtk-b333a8a162e76e92baf521df6ffe9a88d9f0c618.zip
tk-b333a8a162e76e92baf521df6ffe9a88d9f0c618.tar.gz
tk-b333a8a162e76e92baf521df6ffe9a88d9f0c618.tar.bz2
3554026,3561016 Stop crash with tearoff menus.
-rw-r--r--ChangeLog4
-rw-r--r--unix/tkUnixWm.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 292a665..e6e153d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-23 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: [Bugs 3554026,3561016] Stop crash with tearoff menus.
+
2012-08-17 Jan Nijtmans <nijtmans@users.sf.net>
* win/nmakehlp.c: Add "-V<num>" option, in order to be able
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);