mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-26 11:56:47 -08:00
Use empty path if active runtime is not managed
This commit is contained in:
1 parent
f508ecac43
commit
3124d3792a
2 files changed
+4
-5
No files matched your search
@@ -72,16 +72,16 @@ static void move_file(const std::filesystem::path & from, const std::filesystem:
|
||||
}
|
||||
|
||||
active_runtime::active_runtime() :
|
||||
active_runtime_json(xdg_config_home() / "openxr/1/active_runtime.json"), pid(getpid())
|
||||
pid(getpid())
|
||||
{
|
||||
try
|
||||
{
|
||||
std::filesystem::path active_runtime_json = xdg_config_home() / "openxr/1/active_runtime.json";
|
||||
std::filesystem::create_directories(active_runtime_json.parent_path());
|
||||
move_file(active_runtime_json, backup_name(active_runtime_json));
|
||||
|
||||
std::filesystem::create_symlink(manifest_path(), active_runtime_json);
|
||||
|
||||
to_be_deleted = true;
|
||||
this->active_runtime_json = active_runtime_json;
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ active_runtime::~active_runtime()
|
||||
return;
|
||||
try
|
||||
{
|
||||
if (to_be_deleted)
|
||||
if (not active_runtime_json.empty())
|
||||
{
|
||||
std::filesystem::remove(active_runtime_json);
|
||||
move_file(backup_name(active_runtime_json), active_runtime_json);
|
||||
|
||||
Reference in new issue
Block a user