mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
refactor(subsystems&ime): RAII lifecycle
This commit is contained in:
@@ -337,21 +337,23 @@ std::filesystem::path MountPoints::GetRealDirectory(const std::string& mounted_d
|
||||
return mounted_directory;
|
||||
}
|
||||
|
||||
KYTY_SUBSYSTEM_INIT(FileSystem) {
|
||||
void Initialize() {
|
||||
g_mount_points = new MountPoints;
|
||||
g_files = new FileDescriptors;
|
||||
}
|
||||
|
||||
KYTY_SUBSYSTEM_UNEXPECTED_SHUTDOWN(FileSystem) {
|
||||
void EmergencyShutdown() {
|
||||
if (g_files != nullptr) {
|
||||
g_files->CloseAll();
|
||||
}
|
||||
}
|
||||
|
||||
KYTY_SUBSYSTEM_DESTROY(FileSystem) {
|
||||
if (g_files != nullptr) {
|
||||
g_files->CloseAll();
|
||||
}
|
||||
void Shutdown() {
|
||||
EmergencyShutdown();
|
||||
delete g_files;
|
||||
delete g_mount_points;
|
||||
g_files = nullptr;
|
||||
g_mount_points = nullptr;
|
||||
}
|
||||
|
||||
void Mount(const std::filesystem::path& folder, const std::string& point) {
|
||||
|
||||
Reference in New Issue
Block a user