* do not leak ICU timezone
* minor cleanup git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37876 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
308ca58d67
commit
3bf890b9ec
@ -78,10 +78,10 @@ BTimeZone::SetTo(const char* zoneCode)
|
||||
int32_t rawOffset;
|
||||
int32_t dstOffset;
|
||||
UDate nowMillis = 1000 * (double)time(NULL);
|
||||
|
||||
UErrorCode error = U_ZERO_ERROR;
|
||||
icuTimeZone->getOffset(nowMillis, FALSE, rawOffset, dstOffset, error);
|
||||
|
||||
if (error != U_ZERO_ERROR) {
|
||||
if (!U_SUCCESS(error)) {
|
||||
fOffsetFromGMT = 0;
|
||||
fInitStatus = B_ERROR;
|
||||
} else {
|
||||
@ -90,5 +90,7 @@ BTimeZone::SetTo(const char* zoneCode)
|
||||
fInitStatus = B_OK;
|
||||
}
|
||||
|
||||
delete icuTimeZone;
|
||||
|
||||
return fInitStatus;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user