From 57cd30582a77f3c42c4ff32f81e825646104e29b Mon Sep 17 00:00:00 2001 From: davygrvy Date: Wed, 5 May 2004 18:28:39 +0000 Subject: (TclFinalizeEncodingSubsystem): FreeEncoding(systemEncoding); moved to before the hash table itereation as it was causing a double free attempt under some conditions. --- generic/tclEncoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index f1781e5..23b2632 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.20 2004/04/20 02:15:55 davygrvy Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.21 2004/05/05 18:28:39 davygrvy Exp $ */ #include "tclInt.h" @@ -313,6 +313,7 @@ TclFinalizeEncodingSubsystem() Tcl_MutexLock(&encodingMutex); encodingsInitialized = 0; + FreeEncoding(systemEncoding); hPtr = Tcl_FirstHashEntry(&encodingTable, &search); while (hPtr != NULL) { /* @@ -324,7 +325,6 @@ TclFinalizeEncodingSubsystem() FreeEncoding((Tcl_Encoding) Tcl_GetHashValue(hPtr)); hPtr = Tcl_FirstHashEntry(&encodingTable, &search); } - FreeEncoding(systemEncoding); Tcl_DeleteHashTable(&encodingTable); Tcl_MutexUnlock(&encodingMutex); } -- cgit v0.12