From 58e9b099956e99bf63b543f09a06ab880b5166e4 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Sat, 1 Nov 2025 01:54:49 -0400 Subject: [PATCH] livoxGen1: Use RAII to close dlopen handle --- stimBuffApis/livoxGen1/livoxGen1.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stimBuffApis/livoxGen1/livoxGen1.cpp b/stimBuffApis/livoxGen1/livoxGen1.cpp index a98433e..fc36166 100644 --- a/stimBuffApis/livoxGen1/livoxGen1.cpp +++ b/stimBuffApis/livoxGen1/livoxGen1.cpp @@ -497,11 +497,7 @@ extern "C" int livoxGen1_finalizeInd(void) (*livoxProto1.livoxProto1_exit)(); } - if (livoxProto1.dlopenHandle) - { - dlclose(livoxProto1.dlopenHandle.get()); - livoxProto1.dlopenHandle.reset(); - } + livoxProto1.dlopenHandle.reset(nullptr); livoxProto1 = LivoxProto1DllState(); return 0; // Success