mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-26 20:06:42 -08:00
Cleanup active_runtime.json on start
This commit is contained in:
1 parent
ad9a6beb56
commit
5ca8b4bb43
3 files changed
+20
No files matched your search
@@ -238,4 +238,20 @@ active_runtime::~active_runtime()
|
||||
std::cerr << "Cannot unset active OpenVR runtime: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void active_runtime::cleanup_openxr()
|
||||
{
|
||||
for (const auto & manifest: manifest_path())
|
||||
{
|
||||
auto active_runtime = xdg_config_home() / ("openxr/1/active_runtime" + get_abi(manifest) + ".json");
|
||||
std::error_code ec;
|
||||
if (std::filesystem::equivalent(manifest, active_runtime, ec))
|
||||
{
|
||||
std::cerr << "Removing stale file " << active_runtime << std::endl;
|
||||
std::filesystem::remove(active_runtime, ec);
|
||||
}
|
||||
std::filesystem::rename(backup_name(manifest), manifest, ec);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace wivrn
|
||||
Reference in new issue
Block a user