summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dimitry Ivanov <dimitry@google.com> 2018-09-13 23:24:26 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-09-13 23:24:26 +0000
commit7101abd1489eeafbb5248097cbbf56d64ca768c7 (patch)
tree348bc7ad08c412bd2aeafe3bcf08167d2e669b0f
parent97f1cf0a28bd5bd1d2d88de510142015ec42b58f (diff)
parent01728c1e8af91d50ecd2b6fdf9e8bf6e99bd7f60 (diff)
Merge "replace dlclose() with CloseNativeLibrary() in vulkan layer"
-rw-r--r--vulkan/libvulkan/layers_extensions.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/vulkan/libvulkan/layers_extensions.cpp b/vulkan/libvulkan/layers_extensions.cpp
index 96c556393c..b32977a760 100644
--- a/vulkan/libvulkan/layers_extensions.cpp
+++ b/vulkan/libvulkan/layers_extensions.cpp
@@ -165,8 +165,13 @@ void LayerLibrary::Close() {
std::lock_guard<std::mutex> lock(mutex_);
if (--refcount_ == 0) {
ALOGV("closing layer library '%s'", path_.c_str());
- dlclose(dlhandle_);
- dlhandle_ = nullptr;
+ std::string error_msg;
+ if (!android::CloseNativeLibrary(dlhandle_, native_bridge_, &error_msg)) {
+ ALOGE("failed to unload library '%s': %s", path_.c_str(), error_msg.c_str());
+ refcount_++;
+ } else {
+ dlhandle_ = nullptr;
+ }
}
}