From 74cd112addebc7678cb763cc1cb173feb0e61bb2 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 5 Jul 2019 16:03:36 +0100 Subject: COMPMID-2425: Fix memory leak reported by coverity Change-Id: Ia41626a59148978ea72bee9c5358f2748a29144c Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1482 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas --- arm_compute/core/CL/OpenCL.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arm_compute/core/CL') diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h index fc7083d276..fbf603ea00 100644 --- a/arm_compute/core/CL/OpenCL.h +++ b/arm_compute/core/CL/OpenCL.h @@ -64,6 +64,17 @@ private: void load_symbols(void *handle); public: + /** 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; + /** Allow instances of this class to be move constructed */ + CLSymbols(CLSymbols &&) = default; + /** Allow instances of this class to be moved */ + CLSymbols &operator=(CLSymbols &&) = default; + /** Destructor */ + ~CLSymbols(); + /** Get the static instance of CLSymbols. * * @return The static instance of CLSymbols. @@ -138,6 +149,7 @@ public: private: std::pair _loaded{ false, false }; + void *handle{ nullptr }; }; } // namespace arm_compute #endif /* __ARM_COMPUTE_OPENCL_H__ */ -- cgit v1.2.1