*** tclThread.c	2000/04/05 00:42:20	1.5
--- tclThread.c	2001/04/05 23:25:21
***************
*** 449,465 ****
      int i;
  
      TclpMasterLock();
-     for (i=0 ; i<keyRecord.num ; i++) {
- 	keyPtr = (Tcl_ThreadDataKey *)keyRecord.list[i];
- 	TclpFinalizeThreadDataKey(keyPtr);
-     }
-     if (keyRecord.list != NULL) {
- 	ckfree((char *)keyRecord.list);
- 	keyRecord.list = NULL;
-     }
-     keyRecord.max = 0;
-     keyRecord.num = 0;
- 
      for (i=0 ; i<mutexRecord.num ; i++) {
  	mutexPtr = (Tcl_Mutex *)mutexRecord.list[i];
  	if (mutexPtr != NULL) {
--- 449,454 ----
***************
*** 485,490 ****
--- 474,490 ----
      }
      condRecord.max = 0;
      condRecord.num = 0;
+ 
+     for (i=0 ; i<keyRecord.num ; i++) {
+ 	keyPtr = (Tcl_ThreadDataKey *)keyRecord.list[i];
+ 	TclpFinalizeThreadDataKey(keyPtr);
+     }
+     if (keyRecord.list != NULL) {
+ 	ckfree((char *)keyRecord.list);
+ 	keyRecord.list = NULL;
+     }
+     keyRecord.max = 0;
+     keyRecord.num = 0;
  
      TclpMasterUnlock();
  #else

