diff --git a/Core/SDKs/CustomScenario/CustomScenario.cs b/Core/SDKs/CustomScenario/CustomScenario.cs index 849b00f..4fb98a6 100644 --- a/Core/SDKs/CustomScenario/CustomScenario.cs +++ b/Core/SDKs/CustomScenario/CustomScenario.cs @@ -373,10 +373,13 @@ public void Stop(bool inTickError = false) { Console.WriteLine(e); } + if (!inTickError) + { + foreach (var task in _initTasks) task.Value?.Join(); - foreach (var task in _initTasks) task.Value?.Join(); - - foreach (var task in _tickTasks) task.Value?.Join(); + foreach (var task in _tickTasks) task.Value?.Join(); + } + _initTasks.Clear(); _tickTasks.Clear();