From 542700ccb7e629db21dff3193938e9ada97876c2 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 4 Jul 2014 13:38:12 -0400 Subject: [PATCH] Archive: Added Init/Shutdown methods to reset kernel archive state. --- src/core/hle/kernel/archive.cpp | 10 ++++++++++ src/core/hle/kernel/archive.h | 6 ++++++ src/core/hle/kernel/kernel.cpp | 3 +++ 3 files changed, 19 insertions(+) diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index f31c02ea91..76b2520dad 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp @@ -144,4 +144,14 @@ Handle CreateArchive(FileSys::Archive* backend, const std::string& name) { return handle; } +/// Initialize archives +void ArchiveInit() { + g_archive_map.clear(); +} + +/// Shutdown archives +void ArchiveShutdown() { + g_archive_map.clear(); +} + } // namespace Kernel diff --git a/src/core/hle/kernel/archive.h b/src/core/hle/kernel/archive.h index 07fb37ae7c..3758e7061c 100644 --- a/src/core/hle/kernel/archive.h +++ b/src/core/hle/kernel/archive.h @@ -29,4 +29,10 @@ Handle OpenArchive(FileSys::Archive::IdCode id_code); */ Handle CreateArchive(FileSys::Archive* backend, const std::string& name); +/// Initialize archives +void ArchiveInit(); + +/// Shutdown archives +void ArchiveShutdown(); + } // namespace FileSys diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index cda183add7..7d9bd261ec 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -9,6 +9,7 @@ #include "core/core.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" +#include "core/hle/kernel/archive.h" namespace Kernel { @@ -133,11 +134,13 @@ Object* ObjectPool::CreateByIDType(int type) { /// Initialize the kernel void Init() { Kernel::ThreadingInit(); + Kernel::ArchiveInit(); } /// Shutdown the kernel void Shutdown() { Kernel::ThreadingShutdown(); + Kernel::ArchiveShutdown(); g_object_pool.Clear(); // Free all kernel objects }