2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Archive: Added Init/Shutdown methods to reset kernel archive state.

This commit is contained in:
bunnei 2014-07-04 13:38:12 -04:00
parent 1099d83455
commit 542700ccb7
3 changed files with 19 additions and 0 deletions

View file

@ -144,4 +144,14 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name) {
return handle; return handle;
} }
/// Initialize archives
void ArchiveInit() {
g_archive_map.clear();
}
/// Shutdown archives
void ArchiveShutdown() {
g_archive_map.clear();
}
} // namespace Kernel } // namespace Kernel

View file

@ -29,4 +29,10 @@ Handle OpenArchive(FileSys::Archive::IdCode id_code);
*/ */
Handle CreateArchive(FileSys::Archive* backend, const std::string& name); Handle CreateArchive(FileSys::Archive* backend, const std::string& name);
/// Initialize archives
void ArchiveInit();
/// Shutdown archives
void ArchiveShutdown();
} // namespace FileSys } // namespace FileSys

View file

@ -9,6 +9,7 @@
#include "core/core.h" #include "core/core.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/kernel/archive.h"
namespace Kernel { namespace Kernel {
@ -133,11 +134,13 @@ Object* ObjectPool::CreateByIDType(int type) {
/// Initialize the kernel /// Initialize the kernel
void Init() { void Init() {
Kernel::ThreadingInit(); Kernel::ThreadingInit();
Kernel::ArchiveInit();
} }
/// Shutdown the kernel /// Shutdown the kernel
void Shutdown() { void Shutdown() {
Kernel::ThreadingShutdown(); Kernel::ThreadingShutdown();
Kernel::ArchiveShutdown();
g_object_pool.Clear(); // Free all kernel objects g_object_pool.Clear(); // Free all kernel objects
} }