ICU-770 add transliterator cleanup support
X-SVN-Rev: 5820
This commit is contained in:
parent
34a2507c41
commit
e74e4950ed
@ -1440,4 +1440,26 @@ void Transliterator::initializeRegistry(void) {
|
||||
NormalizationTransliterator::registerIDs();
|
||||
}
|
||||
|
||||
// Defined in ucln_in.h:
|
||||
|
||||
/**
|
||||
* Cleanup function for transliterator component; delegates to
|
||||
* Transliterator::cleanupRegistry().
|
||||
*/
|
||||
U_CFUNC UBool transliterator_cleanup(void) {
|
||||
Transliterator::cleanupRegistry();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release all static memory held by transliterator. This will
|
||||
* necessarily invalidate any rule-based transliterators held by the
|
||||
* user, because RBTs hold pointers to common data objects.
|
||||
*/
|
||||
void Transliterator::cleanupRegistry() {
|
||||
Mutex lock(®istryMutex);
|
||||
delete registry;
|
||||
registry = 0;
|
||||
}
|
||||
|
||||
//eof
|
||||
|
@ -22,6 +22,7 @@ static UBool i18n_cleanup(void)
|
||||
ucol_bld_cleanup();
|
||||
ucol_cleanup();
|
||||
timeZone_cleanup();
|
||||
transliterator_cleanup();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -28,4 +28,6 @@ U_CFUNC UBool ucol_bld_cleanup(void);
|
||||
|
||||
U_CFUNC UBool timeZone_cleanup(void);
|
||||
|
||||
U_CFUNC UBool transliterator_cleanup(void);
|
||||
|
||||
#endif
|
||||
|
@ -20,6 +20,8 @@ class Hashtable;
|
||||
class U_I18N_API UVector;
|
||||
class CompoundTransliterator;
|
||||
|
||||
U_CFUNC UBool transliterator_cleanup();
|
||||
|
||||
/**
|
||||
* <code>Transliterator</code> is an abstract class that
|
||||
* transliterates text from one format to another. The most common
|
||||
@ -923,6 +925,9 @@ protected:
|
||||
|
||||
private:
|
||||
static void initializeRegistry(void);
|
||||
|
||||
friend UBool transliterator_cleanup();
|
||||
static void cleanupRegistry(void);
|
||||
};
|
||||
|
||||
inline int32_t Transliterator::getMaximumContextLength(void) const {
|
||||
|
Loading…
Reference in New Issue
Block a user