Index: generic/nsfPointer.c =================================================================== diff -u -r77b8c1919a102d9309079071f070f2f5b48d50a5 -r7c4f1e31560a0f40749b954c2e9af64ae9110cdc --- generic/nsfPointer.c (.../nsfPointer.c) (revision 77b8c1919a102d9309079071f070f2f5b48d50a5) +++ generic/nsfPointer.c (.../nsfPointer.c) (revision 7c4f1e31560a0f40749b954c2e9af64ae9110cdc) @@ -66,6 +66,8 @@ hPtr = Tcl_CreateHashEntry(pointerHashTablePtr, buffer, &isNew); NsfMutexUnlock(&pointerMutex); Tcl_SetHashValue(hPtr, valuePtr); + /*fprintf(stderr, "Nsf_PointerAdd key '%s' prefix '%s' => %p value %p\n", buffer, typeName, hPtr, valuePtr);*/ + Tcl_DStringFree(dsPtr); } else { return NsfPrintError(interp, "no type converter for %s registered", typeName); @@ -102,7 +104,7 @@ NsfMutexLock(&pointerMutex); hPtr = Tcl_CreateHashEntry(pointerHashTablePtr, key, NULL); - + if (hPtr) { valuePtr = Tcl_GetHashValue(hPtr); } @@ -165,7 +167,7 @@ *---------------------------------------------------------------------- */ int -Nsf_PointerDelete(CONST char *key, void *valuePtr) { +Nsf_PointerDelete(CONST char *key, void *valuePtr, int free) { Tcl_HashEntry *hPtr; int result; @@ -176,7 +178,7 @@ ? Tcl_CreateHashEntry(pointerHashTablePtr, key, NULL) : Nsf_PointerGetHptr(valuePtr); if (hPtr) { - ckfree((char *)valuePtr); + if (free) {ckfree((char *)valuePtr);} Tcl_DeleteHashEntry(hPtr); result = TCL_OK; } else { @@ -331,8 +333,14 @@ hPtr = Tcl_NextHashEntry(&hSrch)) { char *key = Tcl_GetHashKey(pointerHashTablePtr, hPtr); void *valuePtr = Tcl_GetHashValue(hPtr); - - fprintf(stderr, "Nsf_PointerExit: we have still an entry %s with value %p\n", key, valuePtr); + + /* + * We can't use NsfLog here any more, since the Tcl procs are + * already deleted. + */ + if (RUNTIME_STATE(interp)->debugLevel >= 2) { + fprintf(stderr, "Nsf_PointerExit: we have still an entry %s with value %p\n", key, valuePtr); + } } Tcl_DeleteHashTable(pointerHashTablePtr); NsfMutexUnlock(&pointerMutex); Index: generic/nsfStack.c =================================================================== diff -u -r7495af656ca04a32826ecb0b6e207f886eaaa7f8 -r7c4f1e31560a0f40749b954c2e9af64ae9110cdc --- generic/nsfStack.c (.../nsfStack.c) (revision 7495af656ca04a32826ecb0b6e207f886eaaa7f8) +++ generic/nsfStack.c (.../nsfStack.c) (revision 7c4f1e31560a0f40749b954c2e9af64ae9110cdc) @@ -792,7 +792,7 @@ static void CallStackPopAll(Tcl_Interp *interp) { - if (RUNTIME_STATE(interp)->debugLevel > 1) { + if (RUNTIME_STATE(interp)->debugLevel > 2) { NsfShowStack(interp); }