Parcourir la source

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

Nikolay Nikolov il y a 1 an
Parent
commit
e03389c6a8
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      rtl/wasi/systhrd.inc

+ 2 - 0
rtl/wasi/systhrd.inc

@@ -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