소스 검색

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

Nikolay Nikolov 1 년 전
부모
커밋
e03389c6a8
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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