From 667ef8fe76715bfd4707a094581a9383ba27df0c Mon Sep 17 00:00:00 2001 From: "Andrew M." Date: Thu, 19 Sep 2024 10:35:06 +0300 Subject: [PATCH] Fix stupid DestoryThreadGroup mistake --- src/vm/vm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm/vm.cpp b/src/vm/vm.cpp index a9cc812e..ae817068 100644 --- a/src/vm/vm.cpp +++ b/src/vm/vm.cpp @@ -400,11 +400,11 @@ void DestroyScriptThreads(uint32_t scriptBufferId) { static void DestroyThreadGroup(uint32_t groupId) { Sc3VmThread* groupThread = ThreadGroupHeads[groupId]; if (groupThread != NULL) { - while (groupThread->NextContext != NULL) { + do { Sc3VmThread* next = groupThread->NextContext; DestroyThread(groupThread); groupThread = next; - } + } while (groupThread != NULL); } ThreadGroupHeads[groupId] = NULL; ThreadGroupTails[groupId] = NULL;