summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-20 10:10:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-20 10:10:34 (GMT)
commit6453a55538a3e3af1fbf3ae0b905988967a2200a (patch)
treeedef1654a0be8eae28d5745f1b68ccbf13712007 /unix
parent688d1318a11f09dd8b0300bf67ac783abe1b85d4 (diff)
downloadtk-6453a55538a3e3af1fbf3ae0b905988967a2200a.zip
tk-6453a55538a3e3af1fbf3ae0b905988967a2200a.tar.gz
tk-6453a55538a3e3af1fbf3ae0b905988967a2200a.tar.bz2
Proposed fix for [c2483bfe4b]: tk fontchooser on macOS can automatically open on startup, can lead to crashes. Which also works for Tcl 8.7 and 9.0
Diffstat (limited to 'unix')
-rw-r--r--unix/tkAppInit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 13bcdde..aa9315c 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -15,6 +15,9 @@
#undef BUILD_tk
#undef STATIC_BUILD
#include "tk.h"
+#if !defined(USE_SYSTEM_EXIT) && defined(MAC_OSX_TK)
+# include "tkMacOSX.h"
+#endif
#ifdef TK_TEST
extern Tcl_PackageInitProc Tktest_Init;
@@ -110,6 +113,11 @@ Tcl_AppInit(
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+#if !defined(USE_SYSTEM_EXIT) && defined(MAC_OSX_TK)
+ if (TkMacOSXIsLaunched()) {
+ Tcl_SetExitProc(TkMacOSXExitProc);
+ }
+#endif
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {