diff options
| author | 2014-06-10 22:43:50 -0400 | |
|---|---|---|
| committer | 2014-06-13 09:51:19 -0400 | |
| commit | f49ac3a2d71f06d603b8401817a6dfd9dbc3c4bc (patch) | |
| tree | f416ede76f0efb6f5e9c6365789dbfa2b48b0bd1 /src | |
| parent | Event: Updated several log messages to be assertions. (diff) | |
| download | yuzu-f49ac3a2d71f06d603b8401817a6dfd9dbc3c4bc.tar.gz yuzu-f49ac3a2d71f06d603b8401817a6dfd9dbc3c4bc.tar.xz yuzu-f49ac3a2d71f06d603b8401817a6dfd9dbc3c4bc.zip | |
Kernel: Added freeing of kernel objects on emulator shutdown.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 6 | ||||
| -rw-r--r-- | src/core/system.cpp | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index e51a9d45a..739ddd4ef 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -132,12 +132,16 @@ Object* ObjectPool::CreateByIDType(int type) { | |||
| 132 | } | 132 | } |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | /// Initialize the kernel | ||
| 135 | void Init() { | 136 | void Init() { |
| 136 | Kernel::ThreadingInit(); | 137 | Kernel::ThreadingInit(); |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 140 | /// Shutdown the kernel | ||
| 139 | void Shutdown() { | 141 | void Shutdown() { |
| 140 | Kernel::ThreadingShutdown(); | 142 | Kernel::ThreadingShutdown(); |
| 143 | |||
| 144 | g_object_pool.Clear(); // Free all kernel objects | ||
| 141 | } | 145 | } |
| 142 | 146 | ||
| 143 | /** | 147 | /** |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index d2d624f6d..3f15da0ac 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -167,6 +167,12 @@ private: | |||
| 167 | extern ObjectPool g_object_pool; | 167 | extern ObjectPool g_object_pool; |
| 168 | extern Handle g_main_thread; | 168 | extern Handle g_main_thread; |
| 169 | 169 | ||
| 170 | /// Initialize the kernel | ||
| 171 | void Init(); | ||
| 172 | |||
| 173 | /// Shutdown the kernel | ||
| 174 | void Shutdown(); | ||
| 175 | |||
| 170 | /** | 176 | /** |
| 171 | * Loads executable stored at specified address | 177 | * Loads executable stored at specified address |
| 172 | * @entry_point Entry point in memory of loaded executable | 178 | * @entry_point Entry point in memory of loaded executable |
diff --git a/src/core/system.cpp b/src/core/system.cpp index c77092327..9b1e96888 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "core/system.h" | 8 | #include "core/system.h" |
| 9 | #include "core/hw/hw.h" | 9 | #include "core/hw/hw.h" |
| 10 | #include "core/hle/hle.h" | 10 | #include "core/hle/hle.h" |
| 11 | #include "core/hle/kernel/kernel.h" | ||
| 11 | 12 | ||
| 12 | #include "video_core/video_core.h" | 13 | #include "video_core/video_core.h" |
| 13 | 14 | ||
| @@ -26,6 +27,7 @@ void Init(EmuWindow* emu_window) { | |||
| 26 | HLE::Init(); | 27 | HLE::Init(); |
| 27 | CoreTiming::Init(); | 28 | CoreTiming::Init(); |
| 28 | VideoCore::Init(emu_window); | 29 | VideoCore::Init(emu_window); |
| 30 | Kernel::Init(); | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | void RunLoopFor(int cycles) { | 33 | void RunLoopFor(int cycles) { |
| @@ -42,6 +44,7 @@ void Shutdown() { | |||
| 42 | HLE::Shutdown(); | 44 | HLE::Shutdown(); |
| 43 | CoreTiming::Shutdown(); | 45 | CoreTiming::Shutdown(); |
| 44 | VideoCore::Shutdown(); | 46 | VideoCore::Shutdown(); |
| 47 | Kernel::Shutdown(); | ||
| 45 | g_ctr_file_system.Shutdown(); | 48 | g_ctr_file_system.Shutdown(); |
| 46 | } | 49 | } |
| 47 | 50 | ||