Index: generic/nsfFunPtrHashTable.c =================================================================== diff -u -r7243f88cec779c0274f22e569790c7ad1216800f -r2124b267f627f20447771d59cc28bd0e308fd1fb --- generic/nsfFunPtrHashTable.c (.../nsfFunPtrHashTable.c) (revision 7243f88cec779c0274f22e569790c7ad1216800f) +++ generic/nsfFunPtrHashTable.c (.../nsfFunPtrHashTable.c) (revision 2124b267f627f20447771d59cc28bd0e308fd1fb) @@ -55,7 +55,9 @@ static unsigned int FunPtrKey(Tcl_HashTable *tablePtr, VOID *keyPtr); static int CompareFunPtrKeys(VOID *keyPtr, Tcl_HashEntry *hPtr); static Tcl_HashEntry *AllocFunPtrEntry(Tcl_HashTable *tablePtr, VOID *keyPtr); +static void FreeFunPtrEntry(Tcl_HashEntry *hPtr); + typedef struct funPtrEntry_t { Nsf_AnyFun *funPtr; } funPtrEntry_t; @@ -66,7 +68,7 @@ FunPtrKey, /* hashKeyProc*/ CompareFunPtrKeys, /* compareKeysProc */ AllocFunPtrEntry, /* allocEntryProc */ - NULL, /* freeEntryProc */ + FreeFunPtrEntry /* freeEntryProc */ }; /* @@ -169,6 +171,30 @@ return hPtr; } +/*---------------------------------------------------------------------- + * + * FreeFunPtrEntry -- + * + * Frees space for a Tcl_HashEntry containing the Nsf_AnyFun * key. + * + * Results: + * None. + * + * Side effects: + * Frees memory for the hash entry and its key. + * + *---------------------------------------------------------------------- + */ + +static void +FreeFunPtrEntry(Tcl_HashEntry *hPtr) +{ + Nsf_AnyFun *keyVal = (Nsf_AnyFun *) hPtr->key.oneWordValue; + ckfree(keyVal); + ckfree(hPtr); +} + + /* *---------------------------------------------------------------------- * Nsf_InitFunPtrHashTable --