summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authorculler <culler>2019-11-07 23:22:34 (GMT)
committerculler <culler>2019-11-07 23:22:34 (GMT)
commit5a3617067387db921c9984395fbe013d68dc1d24 (patch)
treefadbfedc85ba9d5224a37a4723e86ea83db3f6e1 /macosx/tkMacOSXWm.c
parent8f788bba9065216a2ff2c7e9c6d5cbdd2b622b51 (diff)
downloadtk-5a3617067387db921c9984395fbe013d68dc1d24.zip
tk-5a3617067387db921c9984395fbe013d68dc1d24.tar.gz
tk-5a3617067387db921c9984395fbe013d68dc1d24.tar.bz2
Fix [c4abd2b0f3]: Tcl Panic in TkWmStackorderToplevel (for Aqua)
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index c2b67f6..dda6c19 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -3309,18 +3309,18 @@ WmStackorderCmd(
if (objc == 3) {
windows = TkWmStackorderToplevel(winPtr);
- if (windows == NULL) {
- Tcl_Panic("TkWmStackorderToplevel failed");
- }
-
- resultObj = Tcl_NewObj();
- for (windowPtr = windows; *windowPtr ; windowPtr++) {
- Tcl_ListObjAppendElement(NULL, resultObj,
+ if (windows != NULL) {
+ resultObj = Tcl_NewObj();
+ for (windowPtr = windows; *windowPtr ; windowPtr++) {
+ Tcl_ListObjAppendElement(NULL, resultObj,
TkNewWindowObj((Tk_Window) *windowPtr));
+ }
+ Tcl_SetObjResult(interp, resultObj);
+ ckfree(windows);
+ return TCL_OK;
+ } else {
+ return TCL_ERROR;
}
- Tcl_SetObjResult(interp, resultObj);
- ckfree(windows);
- return TCL_OK;
} else {
TkWindow *winPtr2;
int index1 = -1, index2 = -1, result;
@@ -6701,10 +6701,6 @@ TkWmStackorderToplevel(
*windowPtr-- = childWinPtr;
}
}
- if (windowPtr != windows-1) {
- Tcl_Panic("num matched toplevel windows does not equal num "
- "children");
- }
}
done: