mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-5320 Don't use global new and delete
X-SVN-Rev: 20063
This commit is contained in:
parent
f784e6f443
commit
5c6df5e87f
3 changed files with 4 additions and 4 deletions
|
@ -140,7 +140,7 @@ CharsetDetector::CharsetDetector()
|
|||
{
|
||||
setRecognizers();
|
||||
|
||||
resultArray = new CharsetMatch *[fCSRecognizers_size];
|
||||
resultArray = (CharsetMatch **)uprv_malloc(sizeof(CharsetMatch *)*fCSRecognizers_size);
|
||||
|
||||
for(int32_t i = 0; i < fCSRecognizers_size; i += 1) {
|
||||
resultArray[i] = new CharsetMatch();
|
||||
|
@ -155,7 +155,7 @@ CharsetDetector::~CharsetDetector()
|
|||
delete resultArray[i];
|
||||
}
|
||||
|
||||
delete [] resultArray;
|
||||
uprv_free(resultArray);
|
||||
}
|
||||
|
||||
void CharsetDetector::setText(const char *in, int32_t len)
|
||||
|
|
|
@ -27,7 +27,7 @@ U_NAMESPACE_BEGIN
|
|||
// stripped of markup. Detection only considers multi-byte chars, effectively
|
||||
// stripping markup anyway, and double byte chars do occur in markup too.
|
||||
//
|
||||
class IteratedChar
|
||||
class IteratedChar : public UMemory
|
||||
{
|
||||
public:
|
||||
int32_t charValue; // 1-4 bytes from the raw input data
|
||||
|
|
|
@ -56,7 +56,7 @@ void InputText::setDeclaredEncoding(const char* encoding, int32_t len)
|
|||
{
|
||||
if(encoding) {
|
||||
len += 1; // to make place for the \0 at the end.
|
||||
delete[] fDeclaredEncoding;
|
||||
uprv_free(fDeclaredEncoding);
|
||||
fDeclaredEncoding = NEW_ARRAY(char, len);
|
||||
uprv_strncpy(fDeclaredEncoding, encoding, len);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue