summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2012-08-23 21:40:24 (GMT)
committerdgp <dgp@noemail.net>2012-08-23 21:40:24 (GMT)
commit00c496534167fa687e1cfaed395918581c5df92e (patch)
treeb19816dc407b206d638671323e89336484bb8e41
parenta7b4806c7e5ea5e888e42bb1e5af07e7bbc6b9b8 (diff)
downloadtk-00c496534167fa687e1cfaed395918581c5df92e.zip
tk-00c496534167fa687e1cfaed395918581c5df92e.tar.gz
tk-00c496534167fa687e1cfaed395918581c5df92e.tar.bz2
3554026,3561016 Stop crash with tearoff menus.
FossilOrigin-Name: 4dc9a8d8f3c66aac959d1bdbe47ce68516e4d57f
-rw-r--r--ChangeLog4
-rw-r--r--unix/tkUnixWm.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 52d9739..d540456 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 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);