diff options
author | Anthony Barbier <anthony.barbier@arm.com> | 2017-12-14 10:58:47 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | 7b43d311fea58e6fd14317f72ec40c84c5c21fc6 (patch) | |
tree | 2ddbe7f3601ce1651d1199dc9716bb0fbe4c31a5 /src | |
parent | a58b61e803adb90fc4c0459e431da03c690c69a7 (diff) | |
download | ComputeLibrary-7b43d311fea58e6fd14317f72ec40c84c5c21fc6.tar.gz |
COMPMID-556: Don't call dlclose
Calling dlclose on a handle meanse the library will get unloaded and therefore its symbols won't be valid anymore.
Shared libraries are automatically unloaded when the application exits, so we can just 'leak' the handles.
https://stackoverflow.com/questions/26131102/is-it-safe-to-call-dlclose-after-dlsym
Change-Id: I8991af0887e5e48108fe787a77e003dd7c872361
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/113264
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/CL/OpenCL.cpp | 2 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/OpenGLES.cpp | 10 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp index 3a145e0ab3..157b6d6820 100644 --- a/src/core/CL/OpenCL.cpp +++ b/src/core/CL/OpenCL.cpp @@ -110,7 +110,7 @@ bool CLSymbols::load(const std::string &library) #undef LOAD_FUNCTION_PTR - dlclose(handle); + //Don't call dlclose(handle) or all the symbols will be unloaded ! // Disable default loading and set status to successful _loaded = std::make_pair(true, true); diff --git a/src/core/GLES_COMPUTE/OpenGLES.cpp b/src/core/GLES_COMPUTE/OpenGLES.cpp index fdfc085db2..d2539d0775 100644 --- a/src/core/GLES_COMPUTE/OpenGLES.cpp +++ b/src/core/GLES_COMPUTE/OpenGLES.cpp @@ -128,15 +128,7 @@ private: } } - if(glesv3_handle != nullptr) - { - dlclose(glesv3_handle); - } - if(glesv2_handle != nullptr) - { - dlclose(glesv2_handle); - } - dlclose(egl_handle); + //Don't call dlclose(handle) or all the symbols will be unloaded ! } } bool _initialized = false; |