mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-26 20:01:17 +00:00
Ensure tool path cache doesn't get destroyed before adb shuts down
This commit is contained in:
@@ -148,11 +148,19 @@ std::string getToolInSDK(ToolDir subdir, const std::string &jdkroot, const std::
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
struct ToolPathCache
|
||||
{
|
||||
std::string sdk, jdk;
|
||||
std::map<std::string, std::string> paths;
|
||||
} cache;
|
||||
};
|
||||
|
||||
static ToolPathCache &getCache()
|
||||
{
|
||||
static ToolPathCache cache;
|
||||
return cache;
|
||||
}
|
||||
|
||||
std::string getToolPath(ToolDir subdir, const std::string &toolname, bool checkExist)
|
||||
{
|
||||
// search path for tools:
|
||||
@@ -171,6 +179,8 @@ std::string getToolPath(ToolDir subdir, const std::string &toolname, bool checkE
|
||||
std::string sdk = RenderDoc::Inst().GetConfigSetting("androidSDKPath");
|
||||
std::string jdk = RenderDoc::Inst().GetConfigSetting("androidJDKPath");
|
||||
|
||||
ToolPathCache &cache = getCache();
|
||||
|
||||
// invalidate the cache when these settings change
|
||||
if(sdk != cache.sdk || jdk != cache.jdk)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user