summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2004-06-26 09:04:13 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2004-06-26 09:04:13 (GMT)
commit62db82987c41af18ad0badb76107d4bab0bb1b6e (patch)
treecfe11c213050876f72fa09e76a870cd98e5c9be7 /generic
parent4108c25be244c15e88d8d4f81ed9d0b08f148d0d (diff)
downloadtk-62db82987c41af18ad0badb76107d4bab0bb1b6e.zip
tk-62db82987c41af18ad0badb76107d4bab0bb1b6e.tar.gz
tk-62db82987c41af18ad0badb76107d4bab0bb1b6e.tar.bz2
Fix for [Bug 756840]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkConsole.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 0c05fe5..eebac0e 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkConsole.c,v 1.20 2004/03/17 18:15:43 das Exp $
+ * RCS: @(#) $Id: tkConsole.c,v 1.21 2004/06/26 09:04:15 mistachkin Exp $
*/
#include "tk.h"
@@ -639,6 +639,7 @@ InterpreterCmd(clientData, interp, argc, argv)
char c;
size_t length;
int result;
+ Tcl_Interp *consoleInterp;
Tcl_Interp *otherInterp;
if (argc < 2) {
@@ -649,6 +650,8 @@ InterpreterCmd(clientData, interp, argc, argv)
c = argv[1][0];
length = strlen(argv[1]);
+ consoleInterp = info->consoleInterp;
+ Tcl_Preserve((ClientData) consoleInterp);
otherInterp = info->interp;
Tcl_Preserve((ClientData) otherInterp);
if ((c == 'e') && (strncmp(argv[1], "eval", length)) == 0) {
@@ -666,6 +669,7 @@ InterpreterCmd(clientData, interp, argc, argv)
result = TCL_ERROR;
}
Tcl_Release((ClientData) otherInterp);
+ Tcl_Release((ClientData) consoleInterp);
return result;
}
@@ -691,6 +695,17 @@ ConsoleDeleteProc(clientData)
ClientData clientData;
{
ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ /*
+ * Also need to null this out to prevent any further use.
+ *
+ * Fix [Bug #756840]
+ */
+ if (tsdPtr != NULL) {
+ tsdPtr->gStdoutInterp = NULL;
+ }
Tcl_DeleteInterp(info->consoleInterp);
info->consoleInterp = NULL;