ICU-11623 Merge change to reset tz buffer

X-SVN-Rev: 38625
This commit is contained in:
Michael Ow 2016-04-18 22:33:45 +00:00
parent 0ba7b2e17e
commit 13be2f95ae
3 changed files with 20 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1997-2015, International Business Machines
* Copyright (C) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -970,6 +970,15 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
return result;
}
#endif
U_CAPI void U_EXPORT2
uprv_tzname_clear_cache()
{
#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)
gTimeZoneBufferPtr = NULL;
#endif
}
U_CAPI const char* U_EXPORT2
uprv_tzname(int n)
{

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1997-2015, International Business Machines
* Copyright (C) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -478,6 +478,12 @@ U_INTERNAL int32_t U_EXPORT2 uprv_timezone(void);
*/
U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n);
/**
* Reset the global tzname cache.
* @internal
*/
U_INTERNAL void uprv_tzname_clear_cache();
/**
* Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970.
* This function is affected by 'faketime' and should be the bottleneck for all user-visible ICU time functions.

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1997-2015, International Business Machines Corporation and
* Copyright (C) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
@ -458,6 +458,8 @@ TimeZone::detectHostTimeZone()
uprv_tzset(); // Initialize tz... system data
uprv_tzname_clear_cache();
// Get the timezone ID from the host. This function should do
// any required host-specific remapping; e.g., on Windows this
// function maps the Date and Time control panel setting to an