From 3983643839c9f6b6bfd02dc6f4d1ea1e8e8b3c78 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Jan 2013 21:12:27 +0000 Subject: Bug [3601782]: Produce a nice error-message when the first Tcl_InitStubs() fails, in stead of simply abort() --- generic/tkConsole.c | 3 +-- generic/tkMain.c | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index e93c0fc..cbbd260 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -226,8 +226,7 @@ Tk_InitConsoleChannels(interp) Tcl_Channel consoleChannel; /* - * Ensure that we are getting the matching version of Tcl. This is - * really only an issue when Tk is loaded dynamically. + * Ensure that we are getting the matching version of Tcl. */ if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { diff --git a/generic/tkMain.c b/generic/tkMain.c index 5e5ddb7..e88a26f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -144,12 +144,15 @@ Tk_MainEx(argc, argv, appInitProc, interp) ThreadSpecificData *tsdPtr; /* - * Ensure that we are getting the matching version of Tcl. This is - * really only an issue when Tk is loaded dynamically. + * Ensure that we are getting the matching version of Tcl. */ if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { - abort(); + if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { + abort(); + } else { + Tcl_Panic("%s", Tcl_GetStringResult(interp)); + } } #if defined(__WIN32__) && !defined(__WIN64__) && !defined(STATIC_BUILD) -- cgit v0.12