diff options
author | marc_culler <marc.culler@gmail.com> | 2020-10-20 20:15:00 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2020-10-20 20:15:00 (GMT) |
commit | 9c472e72196238d8550cab9eeeb10bf9ed74be31 (patch) | |
tree | e49d916fe830294d7203d1504223cdc46f87a2d9 /macosx/tkMacOSXHLEvents.c | |
parent | 4c940e28df4d5740b0ab2904ed4c673e5678ddf0 (diff) | |
download | tk-9c472e72196238d8550cab9eeeb10bf9ed74be31.zip tk-9c472e72196238d8550cab9eeeb10bf9ed74be31.tar.gz tk-9c472e72196238d8550cab9eeeb10bf9ed74be31.tar.bz2 |
Make Tcl_Finalize run when a launched app is terminated with command-Q
Diffstat (limited to 'macosx/tkMacOSXHLEvents.c')
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 615653d..5055f38 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -570,13 +570,18 @@ TkMacOSXDoHLEvent( static int ReallyKillMe( Tcl_Event *eventPtr, - int flags) + TCL_UNUSED(int)) { Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; int quit = Tcl_FindCommand(interp, "::tk::mac::Quit", NULL, 0)!=NULL; - int code = Tcl_EvalEx(interp, quit ? "::tk::mac::Quit" : "exit", -1, TCL_EVAL_GLOBAL); + if (!quit) { + Tcl_Exit(0); + } + + int code = Tcl_EvalEx(interp, "::tk::mac::Quit", -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { + /* * Should be never reached... */ |