summaryrefslogtreecommitdiffstats
path: root/unix/tkAppInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tkAppInit.c')
-rw-r--r--unix/tkAppInit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 9e6c112..db44bb7 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -15,6 +15,7 @@
#undef BUILD_tk
#undef STATIC_BUILD
#include "tk.h"
+#include "tkPort.h"
#ifdef TK_TEST
#ifdef __cplusplus
@@ -120,6 +121,13 @@ Tcl_AppInit(
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+#if defined(USE_CUSTOM_EXIT_PROC)
+ if (TkpWantsExitProc()) {
+ /* The cast below avoids warnings from old gcc compilers. */
+ Tcl_SetExitProc((void *)TkpExitProc);
+ }
+#endif
+
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;