Преглед изворни кода

Merge branch source:main into main

Curtis Hamilton пре 3 недеља
родитељ
комит
b8b3578d85
3 измењених фајлова са 27 додато и 6 уклоњено
  1. 3 4
      compiler/pdecvar.pas
  2. 23 1
      packages/fcl-base/src/fpthreadpool.pp
  3. 1 1
      tests/webtbf/tw3583.pp

+ 3 - 4
compiler/pdecvar.pas

@@ -391,10 +391,9 @@ implementation
          { property parameters ? }
          if try_to_consume(_LECKKLAMMER) then
            begin
-              // Published indexed properties are allowed in Delphi in interfaces compiled with {$M+}.
-              if (p.visibility=vis_published)
-                  and (astruct is tobjectdef)
-                  and not (tobjectdef(aStruct).objecttype in [odt_interfacecom,odt_dispinterface]) then
+              { Published indexed properties are allowed in Delphi in interfaces compiled with $M+. }
+              if (p.visibility=vis_published) and
+                not((m_delphi in current_settings.modeswitches) and is_interfacecom_or_dispinterface(astruct)) then
                 Message(parser_e_cant_publish_that_property);
               { create a list of the parameters }
               p.parast:=tparasymtable.create(nil,0);

+ 23 - 1
packages/fcl-base/src/fpthreadpool.pp

@@ -472,7 +472,29 @@ begin
 end;
 
 destructor TFPCustomSimpleThreadPool.TThreadPoolList.Destroy;
-begin
+var
+  Threads: array of TThread = ();
+  Thread: TThread;
+  TempList: TList;
+  I: Integer;
+begin
+  TempList := FList.LockList;
+
+  { Copy threads to a separate array to avoid holding the lock while terminating threads }
+  SetLength(Threads, TempList.Count);
+  for I := 0 to TempList.Count - 1 do
+    Threads[I] := TThread(TempList[I]);
+
+  FList.UnlockList;
+
+  { Now terminate and free threads outside the lock }
+  for Thread in Threads do
+  begin
+    Thread.Terminate;
+    Thread.WaitFor;
+    Thread.Free;
+  end;
+
   FreeAndNil(FList);
   Inherited;
 end;

+ 1 - 1
tests/webtbf/tw3583.pp

@@ -1,4 +1,4 @@
-{ %FAIL }
+{ %fail }
 {$mode objfpc}
 type
   IGUserData = interface(IInvokable)