Make path utils return std::string.
This avoids potential issues with returning local variables. It
also solves potential threading conflicts by returning the string
value instead of a pointer. The code should be optimized with RVO
with a modern c++ compiler.
Bug: angleproject:2601
Change-Id: I8a01702d2675a17dd060f27920105efab0c49454
Reviewed-on: https://chromium-review.googlesource.com/c/1415910
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index e48893e..f746742 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -366,8 +366,8 @@
else
{
mPreviousCWD = cwd.value();
- const char *exeDir = angle::GetExecutableDirectory();
- mChangedCWD = angle::SetCWD(exeDir);
+ std::string exeDir = angle::GetExecutableDirectory();
+ mChangedCWD = angle::SetCWD(exeDir.c_str());
if (!mChangedCWD)
{
ERR() << "Error setting CWD for Vulkan layers init.";