From d62ef4d0df239790a3ccb304ce6dd85ed399fa74 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 19 Feb 2021 19:42:57 +0000 Subject: Close loaded library on OpenCL symbols destruction Although is not needed we call dlclose on the loaded library on destruction to avoid resource leak complains from static analysers Resolves: COMPMID-4170 Signed-off-by: Georgios Pinitas Change-Id: I6047681d04309a5854b2f420f064176625c115e9 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5117 Tested-by: Arm Jenkins Reviewed-by: Giorgio Arena Reviewed-by: Manuel Bottini Comments-Addressed: Arm Jenkins --- arm_compute/core/CL/OpenCL.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arm_compute/core/CL/OpenCL.h') diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h index 155c3e4eef..64b24dba8f 100644 --- a/arm_compute/core/CL/OpenCL.h +++ b/arm_compute/core/CL/OpenCL.h @@ -63,6 +63,12 @@ class CLSymbols final public: /** Default Constructor */ CLSymbols() noexcept(false); + /** Destructor */ + ~CLSymbols(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLSymbols(const CLSymbols &) = delete; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLSymbols &operator=(const CLSymbols &) = delete; /** Load OpenCL symbols from handle * * @param[in] handle Handle to load symbols from @@ -144,6 +150,7 @@ public: private: std::pair _loaded; + void *_handle; }; } // namespace arm_compute #endif /* ARM_COMPUTE_OPENCL_H */ -- cgit v1.2.1