- try to fix a memory leak

This commit is contained in:
SoftCoder 2017-10-07 11:14:26 -07:00
parent a413fb5c31
commit 9274f2b5e2
1 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,9 @@ protected:
static Mutex mutexMap(CODE_AT_LINE);
if(itemCacheMutexList.find(cacheKey) == itemCacheMutexList.end()) {
MutexSafeWrapper safeMutex(&mutexMap);
itemCacheMutexList[cacheKey] = new Mutex(CODE_AT_LINE);
if(itemCacheMutexList.find(cacheKey) == itemCacheMutexList.end()) {
itemCacheMutexList[cacheKey] = new Mutex(CODE_AT_LINE);
}
safeMutex.ReleaseLock();
}
Mutex *mutex = itemCacheMutexList[cacheKey];