summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-08-23 21:42:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-08-23 21:42:51 (GMT)
commit0a14aa5c2942393da63f2ff7cab77aa818e84011 (patch)
tree1b2880cd4325f320f1eea8275306468ba4ea32f9
parent5644174d076bb4ef5244db03729d6b9b1bc7f03b (diff)
parentc0a9fce973031291671d7ad72ec9a6e766125d6d (diff)
downloadtk-0a14aa5c2942393da63f2ff7cab77aa818e84011.zip
tk-0a14aa5c2942393da63f2ff7cab77aa818e84011.tar.gz
tk-0a14aa5c2942393da63f2ff7cab77aa818e84011.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 6d9fee9..0e78aae 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-23 Jan Nijtmans <nijtmans@users.sf.net>
* library/tk.tcl: [Bug 3555644]: Better use of virtual events,
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 09cd08d..60aaceb 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -6759,6 +6759,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);