mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-1007 memory cleanup
X-SVN-Rev: 5701
This commit is contained in:
parent
2bdcad5bb8
commit
6cc849aea3
1 changed files with 19 additions and 1 deletions
|
@ -130,6 +130,18 @@ static UVersionInfo dataVersion={ 3, 1, 0, 0 };
|
|||
|
||||
U_CDECL_BEGIN
|
||||
|
||||
U_CFUNC UBool U_CALLCONV
|
||||
unorm_cleanup() {
|
||||
if(normData!=NULL) {
|
||||
udata_close(normData);
|
||||
normData=NULL;
|
||||
}
|
||||
dataErrorCode=U_ZERO_ERROR;
|
||||
haveNormData=0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static UBool U_CALLCONV
|
||||
isAcceptable(void * /* context */,
|
||||
const char * /* type */, const char * /* name */,
|
||||
|
@ -2055,7 +2067,8 @@ unorm_compose(UChar *dest, int32_t destCapacity,
|
|||
pErrorCode);
|
||||
|
||||
if(p==NULL) {
|
||||
return 0; /* an error occurred (out of memory) */
|
||||
destIndex=0; /* an error occurred (out of memory) */
|
||||
break;
|
||||
}
|
||||
|
||||
/* append the recomposed buffer contents to the destination buffer */
|
||||
|
@ -2112,6 +2125,11 @@ unorm_compose(UChar *dest, int32_t destCapacity,
|
|||
}
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
if(buffer!=stackBuffer) {
|
||||
uprv_free(buffer);
|
||||
}
|
||||
|
||||
return u_terminateUChars(dest, destCapacity, destIndex, pErrorCode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue