From 9293760d0a830cbdb2f93f567716d148a339af54 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Mon, 10 Dec 2018 23:29:08 -0500 Subject: [PATCH] Core, test: perform kernel and memory destruction in the correct order The change in test is temporary due to it accessing global state --- src/core/core.h | 4 +--- src/tests/core/arm/arm_test_common.cpp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/core.h b/src/core/core.h index 81d0dfffdb..365b8063c2 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -276,12 +276,10 @@ private: public: // HACK: this is temporary exposed for tests, // due to WIP kernel refactor causing desync state in memory + std::unique_ptr memory; std::unique_ptr kernel; std::unique_ptr timing; - /// Memory system - std::unique_ptr memory; - private: static System s_instance; diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index ff8f5406ae..acadf4d53d 100644 --- a/src/tests/core/arm/arm_test_common.cpp +++ b/src/tests/core/arm/arm_test_common.cpp @@ -40,6 +40,7 @@ TestEnvironment::~TestEnvironment() { Memory::MemorySystem& memory = *Core::System::GetInstance().memory; memory.UnmapRegion(*page_table, 0x80000000, 0x80000000); memory.UnmapRegion(*page_table, 0x00000000, 0x80000000); + Core::System::GetInstance().kernel.reset(); } void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) {