mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-02-01 20:32:48 +00:00
Added a scope guard for WritePlaceHolder
This commit is contained in:
parent
d6ff261fcc
commit
7bcf2276a7
1 changed files with 3 additions and 1 deletions
|
@ -155,6 +155,8 @@ namespace sts::ncm {
|
||||||
}
|
}
|
||||||
} R_END_TRY_CATCH;
|
} R_END_TRY_CATCH;
|
||||||
|
|
||||||
|
auto file_guard = SCOPE_GUARD { fclose(f); };
|
||||||
|
|
||||||
if (fseek(f, offset, SEEK_SET) != 0) {
|
if (fseek(f, offset, SEEK_SET) != 0) {
|
||||||
return fsdevGetLastResult();
|
return fsdevGetLastResult();
|
||||||
}
|
}
|
||||||
|
@ -168,7 +170,7 @@ namespace sts::ncm {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->placeholder_accessor.StoreToCache(f, placeholder_id);
|
this->placeholder_accessor.StoreToCache(f, placeholder_id);
|
||||||
|
file_guard.Cancel();
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue