aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CL/OpenCL.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp
index ef03a5a302..0212774161 100644
--- a/src/core/CL/OpenCL.cpp
+++ b/src/core/CL/OpenCL.cpp
@@ -35,6 +35,14 @@ 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" };
@@ -61,7 +69,7 @@ bool CLSymbols::load_default()
bool CLSymbols::load(const std::string &library)
{
- void *handle = dlopen(library.c_str(), RTLD_LAZY | RTLD_LOCAL);
+ handle = dlopen(library.c_str(), RTLD_LAZY | RTLD_LOCAL);
if(handle == nullptr)
{