From 2feb40f14dd54e819078cd8ac1df0a3f2e8b2902 Mon Sep 17 00:00:00 2001
From: Kelebek1 <eeeedddccc@hotmail.co.uk>
Date: Mon, 1 May 2023 00:27:12 +0100
Subject: [PATCH] Wait for the terminate event before destroying a system
 instance

---
 src/audio_core/renderer/system.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp
index ad869facb7..53b258c4f4 100644
--- a/src/audio_core/renderer/system.cpp
+++ b/src/audio_core/renderer/system.cpp
@@ -436,10 +436,7 @@ void System::Stop() {
     }
 
     if (execution_mode == ExecutionMode::Auto) {
-        // Should wait for the system to terminate here, but core timing (should have) already
-        // stopped, so this isn't needed. Find a way to make this definite.
-
-        // terminate_event.Wait();
+        terminate_event.Wait();
     }
 }