diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-07-11 13:12:46 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-07-11 14:42:29 +0000 |
commit | 0ec65b8c6438b6d12f17487fdc4c870fe37c7caa (patch) | |
tree | cca418fc80d94b9e55fd98b86bb0fdaaee9024f5 | |
parent | d473386e4d5e0edcf55e13a2bf3c422a23fac0de (diff) | |
download | ComputeLibrary-0ec65b8c6438b6d12f17487fdc4c870fe37c7caa.tar.gz |
Revert "COMPMID-2425: Fix memory leak reported by coverity"
This reverts commit 74cd112addebc7678cb763cc1cb173feb0e61bb2.
Reason for revert: Makes platforms to hang in some cases
Change-Id: I8f25f6976fec9fbce0869b7b27502e4895306b5f
Reviewed-on: https://review.mlplatform.org/c/1521
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r-- | arm_compute/core/CL/OpenCL.h | 12 | ||||
-rw-r--r-- | src/core/CL/OpenCL.cpp | 10 |
2 files changed, 1 insertions, 21 deletions
diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h index fbf603ea00..fc7083d276 100644 --- a/arm_compute/core/CL/OpenCL.h +++ b/arm_compute/core/CL/OpenCL.h @@ -64,17 +64,6 @@ 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. @@ -149,7 +138,6 @@ public: private: std::pair<bool, bool> _loaded{ false, false }; - void *handle{ nullptr }; }; } // namespace arm_compute #endif /* __ARM_COMPUTE_OPENCL_H__ */ diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp index 0212774161..ef03a5a302 100644 --- a/src/core/CL/OpenCL.cpp +++ b/src/core/CL/OpenCL.cpp @@ -35,14 +35,6 @@ CLSymbols &CLSymbols::get() return symbols; } -CLSymbols::~CLSymbols() -{ - if(handle) - { - dlclose(handle); - } -} - bool CLSymbols::load_default() { static const std::vector<std::string> libraries{ "libOpenCL.so", "libGLES_mali.so", "libmali.so" }; @@ -69,7 +61,7 @@ bool CLSymbols::load_default() bool CLSymbols::load(const std::string &library) { - handle = dlopen(library.c_str(), RTLD_LAZY | RTLD_LOCAL); + void *handle = dlopen(library.c_str(), RTLD_LAZY | RTLD_LOCAL); if(handle == nullptr) { |