* WebAssembly threads: destroy the event and mutex in WasiBeginThread in case wasi_thread_spawn fails

This commit is contained in:
Nikolay Nikolov 2024-08-07 17:06:03 +03:00
parent 77d592221a
commit e03389c6a8

View File

@ -399,6 +399,8 @@ begin
else
begin
{$IFDEF DEBUGWASMTHREADS}DebugWriteln('WasiBeginThread: spawn thread failed');{$ENDIF}
WasiRTLEventDestroy(T^.DoneEvent);
DoneMutex(T^.Running);
if Assigned(T^.StackBlock) then
FreeMem(T^.StackBlock);
if Assigned(T^.TLSBlock) then