From be09b4429688705a6789272ab237b246260e3ba3 Mon Sep 17 00:00:00 2001 From: "jaesick.shin" Date: Tue, 26 Jul 2016 21:08:52 +0900 Subject: [PATCH] Destroy mutex and mutex Attribute in ProviderMemoryCache. Added Destroy logic about NSCacheMutex and NSCacheMutex Attribute. Second patch remove the white space. Change-Id: I68bdbce9bcb4addf3e910f2b4929318e5308cf5c Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/9729 Reviewed-by: Uze Choi Tested-by: Uze Choi --- service/notification/src/provider/NSProviderInterface.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/service/notification/src/provider/NSProviderInterface.c b/service/notification/src/provider/NSProviderInterface.c index ae29be0..789eda3 100644 --- a/service/notification/src/provider/NSProviderInterface.c +++ b/service/notification/src/provider/NSProviderInterface.c @@ -92,6 +92,15 @@ void NSSetList() NS_LOG(DEBUG, "NSSetList - OUT"); } +void NSDestroyList() +{ + NSStorageDestroy(consumerSubList); + NSStorageDestroy(messageList); + + pthread_mutex_destroy(&NSCacheMutex); + pthread_mutexattr_destroy(&NSCacheMutexAttr); +} + NSResult NSStopProvider() { NS_LOG(DEBUG, "NSStopProvider - IN"); @@ -104,8 +113,7 @@ NSResult NSStopProvider() NSRegisterSubscribeRequestCb((NSSubscribeRequestCallback)NULL); NSRegisterSyncCb((NSProviderSyncInfoCallback)NULL); NSStopScheduler(); - NSStorageDestroy(consumerSubList); - NSStorageDestroy(messageList); + NSDestroyList(); initProvider = false; } -- 2.7.4