mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 16:14:25 -04:00
os: remove ManagedHandle, refactor to use NativeHandle typename
This commit is contained in:
parent
a774833790
commit
6f76066d24
71 changed files with 473 additions and 397 deletions
|
@ -22,7 +22,7 @@ namespace ams::fssystem {
|
|||
constexpr inline size_t MaxExternalCodeFileSystem = 0x10;
|
||||
|
||||
util::BoundedMap<ncm::ProgramId, fs::RemoteFileSystem, MaxExternalCodeFileSystem> g_ecs_map;
|
||||
util::BoundedMap<ncm::ProgramId, os::ManagedHandle, MaxExternalCodeFileSystem> g_hnd_map;
|
||||
util::BoundedMap<ncm::ProgramId, os::NativeHandle, MaxExternalCodeFileSystem> g_hnd_map;
|
||||
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace ams::fssystem {
|
|||
if (auto *hnd = g_hnd_map.Find(program_id); hnd != nullptr) {
|
||||
/* Create a service using libnx bindings. */
|
||||
Service srv;
|
||||
serviceCreate(std::addressof(srv), hnd->Move());
|
||||
serviceCreate(std::addressof(srv), *hnd);
|
||||
g_hnd_map.Remove(program_id);
|
||||
|
||||
/* Create a remote filesystem. */
|
||||
|
@ -66,7 +66,11 @@ namespace ams::fssystem {
|
|||
|
||||
void DestroyExternalCode(ncm::ProgramId program_id) {
|
||||
g_ecs_map.Remove(program_id);
|
||||
g_hnd_map.Remove(program_id);
|
||||
|
||||
if (auto *hnd = g_hnd_map.Find(program_id); hnd != nullptr) {
|
||||
os::CloseNativeHandle(*hnd);
|
||||
g_hnd_map.Remove(program_id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue