ICU-2135 service memory leaks

X-SVN-Rev: 10478
This commit is contained in:
Doug Felt 2002-12-04 18:50:01 +00:00
parent 685aa28a20
commit a382d860fa
3 changed files with 10 additions and 4 deletions

View file

@ -85,9 +85,12 @@ class U_COMMON_API ICUNotifier : public UMemory {
}
virtual ~ICUNotifier(void) {
Mutex lmx(&notifyLock);
delete listeners;
listeners = NULL;
{
Mutex lmx(&notifyLock);
delete listeners;
listeners = NULL;
}
umtx_destroy(&notifyLock);
}
/**

View file

@ -716,6 +716,7 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
UObject* service = f->create(key, this, status);
if (U_FAILURE(status)) {
delete cacheDescriptorList;
delete service;
return NULL;
}
if (service != NULL) {

View file

@ -637,7 +637,6 @@ ICUServiceTest::testAPI_Two()
service.registerFactory(f, status);
}
// iterate over the visual ids returned by the multiple factory
{
UErrorCode status = U_ZERO_ERROR;
@ -648,6 +647,7 @@ ICUServiceTest::testAPI_Two()
UnicodeString* result = (UnicodeString*)service.get(*id, status);
if (result) {
logln(" " + *id + " --> " + *result);
delete result;
} else {
errln("could not find " + *id);
}
@ -1361,6 +1361,8 @@ void ICUServiceTest::testCoverage()
delete obj;
}
delete key;
#if 0
// ResourceBundleFactory
ICUResourceBundleFactory rbf = new ICUResourceBundleFactory();