From 1a5f2e290ba831ad6d18514bcdfcd92673643e4b Mon Sep 17 00:00:00 2001
From: Fernando Sahmkow <fsahmkow27@gmail.com>
Date: Thu, 12 Mar 2020 19:55:53 -0400
Subject: CPU_Manager: Correct stopping on SingleCore.

---
 src/core/cpu_manager.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/core/cpu_manager.cpp')

diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 9e2e6d49fb..e92b0fb376 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -39,9 +39,14 @@ void CpuManager::Initialize() {
 void CpuManager::Shutdown() {
     running_mode = false;
     Pause(false);
-    for (std::size_t core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
-        core_data[core].host_thread->join();
-        core_data[core].host_thread.reset();
+    if (is_multicore) {
+        for (std::size_t core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
+            core_data[core].host_thread->join();
+            core_data[core].host_thread.reset();
+        }
+    } else {
+        core_data[0].host_thread->join();
+        core_data[0].host_thread.reset();
     }
 }
 
-- 
cgit v1.2.3-70-g09d2