From 65d8c3d382a2d6c0cecd6ffc4bd5b6e992463170 Mon Sep 17 00:00:00 2001 From: Deepthi C Shetty <115452109+dshett549@users.noreply.github.com> Date: Mon, 28 Oct 2024 20:10:00 +0530 Subject: [PATCH] RDKB-57423: Observed errors when ran valgrind for rbusTestConsumer -a (#228) Reason for change: Fixed errors when ran valgrind for rbusTestConsumer -a Test Procedure: run rbusTestConsumer with valgrind Risks: None. Signed-off-by: Deepthi C Shetty Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com> --- src/rbus/rbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rbus/rbus.c b/src/rbus/rbus.c index dc3f25d8..4fde4e70 100644 --- a/src/rbus/rbus.c +++ b/src/rbus/rbus.c @@ -3104,6 +3104,8 @@ rbusError_t rbus_close(rbusHandle_t handle) componentName = handleInfo->componentName; handleInfo->componentName=NULL; + ERROR_CHECK(pthread_mutex_destroy(&handleInfo->handle_eventSubsMutex)); + ERROR_CHECK(pthread_mutex_destroy(&handleInfo->handle_subsMutex)); rbusHandleList_Remove(handleInfo); if(rbusHandleList_IsEmpty()) @@ -3126,8 +3128,6 @@ rbusError_t rbus_close(rbusHandle_t handle) _rbus_open_pre_initialize(false); } - ERROR_CHECK(pthread_mutex_destroy(&handleInfo->handle_eventSubsMutex)); - ERROR_CHECK(pthread_mutex_destroy(&handleInfo->handle_subsMutex)); UnlockMutex();