From 9274f2b5e22cc8e91ea4c7db58f69da3b2224198 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sat, 7 Oct 2017 11:14:26 -0700 Subject: [PATCH] - try to fix a memory leak --- source/shared_lib/include/platform/common/cache_manager.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/include/platform/common/cache_manager.h b/source/shared_lib/include/platform/common/cache_manager.h index eca956154..3ed96bf37 100644 --- a/source/shared_lib/include/platform/common/cache_manager.h +++ b/source/shared_lib/include/platform/common/cache_manager.h @@ -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];