Index: tclEvent.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEvent.c,v
retrieving revision 1.23
diff -u -r1.23 tclEvent.c
--- tclEvent.c  5 Aug 2002 03:24:40 -0000       1.23
+++ tclEvent.c  14 Oct 2002 14:31:19 -0000
@@ -812,21 +812,6 @@
        TclFinalizeCompExecEnv();
        TclFinalizeEnvironment();

-       TclFinalizeEncodingSubsystem();
-
-       if (tclExecutableName != NULL) {
-           ckfree(tclExecutableName);
-           tclExecutableName = NULL;
-       }
-       if (tclNativeExecutableName != NULL) {
-           ckfree(tclNativeExecutableName);
-           tclNativeExecutableName = NULL;
-       }
-       if (tclDefaultEncodingDir != NULL) {
-           ckfree(tclDefaultEncodingDir);
-           tclDefaultEncodingDir = NULL;
-       }
-
        Tcl_SetPanicProc(NULL);

        /*
@@ -843,6 +828,21 @@
         */
        TclFinalizeFilesystem();

+       TclFinalizeEncodingSubsystem();
+
+       if (tclExecutableName != NULL) {
+           ckfree(tclExecutableName);
+           tclExecutableName = NULL;
+       }
+       if (tclNativeExecutableName != NULL) {
+           ckfree(tclNativeExecutableName);
+           tclNativeExecutableName = NULL;
+       }
+       if (tclDefaultEncodingDir != NULL) {
+           ckfree(tclDefaultEncodingDir);
+           tclDefaultEncodingDir = NULL;
+       }
+
        /*
         * There shouldn't be any malloc'ed memory after this.
         */
