Skip to content

Commit 18fa6f6

Browse files
committed
(windows, noregistry only) invalidate base fields cache for TZ ":localtime", if TZ-epoch changed (without registry module and real TZ name, the local data epoch may be updated, but cache may contain offset of previos TZ, so ensure it'd be invalidated)
1 parent 50f8455 commit 18fa6f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

generic/tclClock.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,11 @@ ClockConfigureObjCmd(
10351035
Tcl_SetObjRef(dataPtr->systemTimeZone, objv[i]);
10361036
Tcl_UnsetObjRef(dataPtr->systemSetupTZData);
10371037
}
1038-
dataPtr->lastTZEpoch = lastTZEpoch;
1038+
if (dataPtr->lastTZEpoch != lastTZEpoch) {
1039+
dataPtr->lastTZEpoch = lastTZEpoch;
1040+
/* TZ epoch changed - invalidate base-cache */
1041+
Tcl_UnsetObjRef(dataPtr->lastBase.timezoneObj);
1042+
}
10391043
}
10401044
if (i+1 >= objc && dataPtr->systemTimeZone != NULL
10411045
&& dataPtr->lastTZEpoch == lastTZEpoch) {

0 commit comments

Comments
 (0)