From a4f2ba7f4857c10ed2f89c8db768a544b1dc1520 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 12 Apr 2024 19:37:02 +0000 Subject: A crude protection against accessing the storage after it has been freed by a finalization pass. There are probably better fixes, but this silences the valgrind memory errors. --- generic/tclClockFmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c index 8e99f20..e63b642 100644 --- a/generic/tclClockFmt.c +++ b/generic/tclClockFmt.c @@ -679,7 +679,7 @@ ClockFmtObj_FreeInternalRep( Tcl_Obj *objPtr) { ClockFmtScnStorage *fss = ObjClockFmtScn(objPtr); - if (fss != NULL) { + if (fss != NULL && initialized) { Tcl_MutexLock(&ClockFmtMutex); /* decrement object reference count of format/scan storage */ if (--fss->objRefCount <= 0) { -- cgit v0.12