Explorar o código

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

Nikolay Nikolov hai 1 ano
pai
achega
e03389c6a8
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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