diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-02-19 19:42:57 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-02-22 18:21:32 +0000 |
commit | d62ef4d0df239790a3ccb304ce6dd85ed399fa74 (patch) | |
tree | 5603c0395377de77eacb5cd1d8f4e37a4571cf46 /arm_compute/core | |
parent | b1ff7f7baafeba0443bd460793c60b1ce40a405f (diff) | |
download | ComputeLibrary-d62ef4d0df239790a3ccb304ce6dd85ed399fa74.tar.gz |
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 <georgios.pinitas@arm.com>
Change-Id: I6047681d04309a5854b2f420f064176625c115e9
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5117
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/CL/OpenCL.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<bool, bool> _loaded; + void *_handle; }; } // namespace arm_compute #endif /* ARM_COMPUTE_OPENCL_H */ |