summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 6935782..42f5465 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.160 2005/06/06 23:45:43 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.161 2005/06/14 13:46:02 dkf Exp $
*/
#include "tclInt.h"
@@ -2504,11 +2504,16 @@ Tcl_DeleteCommandFromToken(interp, cmd)
/*
* Another deletion is already in progress. Remove the hash
* table entry now, but don't invoke a callback or free the
- * command structure.
+ * command structure. Take care to only remove the hash entry
+ * if it has not already been removed; otherwise if we manage
+ * to hit this function three times, everything goes up in
+ * smoke. [Bug 1220058]
*/
- Tcl_DeleteHashEntry(cmdPtr->hPtr);
- cmdPtr->hPtr = NULL;
+ if (cmdPtr->hPtr != NULL) {
+ Tcl_DeleteHashEntry(cmdPtr->hPtr);
+ cmdPtr->hPtr = NULL;
+ }
return 0;
}