summaryrefslogtreecommitdiffstats
path: root/win/winMain.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy>2003-12-11 03:32:05 (GMT)
committerdavygrvy <davygrvy>2003-12-11 03:32:05 (GMT)
commitd361604df94801ca13f7925809f1fc4627a25a45 (patch)
treec1398fe2761d48ca961a5a28232e44379d6f43e7 /win/winMain.c
parentfe44218e5bf30dcdfe939cb469cd5ef43a5eb78c (diff)
downloadtk-d361604df94801ca13f7925809f1fc4627a25a45.zip
tk-d361604df94801ca13f7925809f1fc4627a25a45.tar.gz
tk-d361604df94801ca13f7925809f1fc4627a25a45.tar.bz2
(WishPanic) : placed ExitProcess() in a __try block (SEH) to catch any
exceptions that might happen. As Tcl will call Tcl_Finalize from its DllMain due to the unload from ExitProcess() unloading Tcl, and if Tcl_Panic had gotten called in an __except block, this avoid the possibility of not being able to exit. Falls to TerminateProcess() in the __except case. Removed the #ifdef _MSC_VER around DebugBreak as that function exists in kernel32.dll and is not compiler dependent. I'd prefer to use if (IsDebuggerPresent()) DebugBreak(); but IsDebuggerPresent() isn't available in all kernel32.dll modules for all versions of windows.
Diffstat (limited to 'win/winMain.c')
-rw-r--r--win/winMain.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/win/winMain.c b/win/winMain.c
index edfd42f..1f4392f 100644
--- a/win/winMain.c
+++ b/win/winMain.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: winMain.c,v 1.15 2002/11/04 07:49:43 davygrvy Exp $
+ * RCS: @(#) $Id: winMain.c,v 1.15.2.1 2003/12/11 03:32:05 davygrvy Exp $
*/
#include <tk.h>
@@ -239,10 +239,12 @@ WishPanic TCL_VARARGS_DEF(CONST char *,arg1)
MessageBeep(MB_ICONEXCLAMATION);
MessageBox(NULL, buf, "Fatal Error in Wish",
MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
-#ifdef _MSC_VER
DebugBreak();
-#endif
- ExitProcess(1);
+ __try {
+ ExitProcess(EXIT_FAILURE);
+ } __except (EXCEPTION_EXECUTE_HANDLER) {
+ TerminateProcess(GetCurrentProcess(), EXIT_FAILURE);
+ }
}
/*
*-------------------------------------------------------------------------