diff options
author | culler <culler> | 2019-11-17 16:53:11 (GMT) |
---|---|---|
committer | culler <culler> | 2019-11-17 16:53:11 (GMT) |
commit | 5fa1f5ca17abac3ec8d2d646fbf138502a0f4a59 (patch) | |
tree | 64e243c4c3c32c5add2d7c572c79957f1d63f6ad /win/tkWinWm.c | |
parent | 321eba4fe5834e3df10efbbd71255704a011d2d8 (diff) | |
parent | 1dcfa065cbd9c94750fabda9313008e76e4d9c87 (diff) | |
download | tk-5fa1f5ca17abac3ec8d2d646fbf138502a0f4a59.zip tk-5fa1f5ca17abac3ec8d2d646fbf138502a0f4a59.tar.gz tk-5fa1f5ca17abac3ec8d2d646fbf138502a0f4a59.tar.bz2 |
Fix [c4abd2b0f3]: rework stackorder command on all platforms, and prevent panics on macOS.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index d273b4c..ba10c63 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -5189,18 +5189,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, - TkNewWindowObj((Tk_Window) *windowPtr)); + 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, **winPtr2Ptr = &winPtr2; int index1 = -1, index2 = -1, result; @@ -6807,8 +6807,6 @@ TkWmStackorderToplevel( (LPARAM) &pair) == 0) { ckfree(windows); windows = NULL; - } else if (pair.windowPtr != (windows-1)) { - Tcl_Panic("num matched toplevel windows does not equal num children"); } done: |