Merge "replace dlclose() with CloseNativeLibrary() in vulkan layer" am: 7101abd148 am: 553065f3cb
am: e40935f304
Change-Id: Icf304ff4c2bf77f676c8e164d5b251b16fe1c153
diff --git a/vulkan/libvulkan/layers_extensions.cpp b/vulkan/libvulkan/layers_extensions.cpp
index 96c5563..b32977a 100644
--- a/vulkan/libvulkan/layers_extensions.cpp
+++ b/vulkan/libvulkan/layers_extensions.cpp
@@ -165,8 +165,13 @@
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;
+ }
}
}