فهرست منبع

Merge branch source:main into main

Curtis Hamilton 1 ماه پیش
والد
کامیت
e10f438219

+ 3 - 4
.gitlab/issue_templates/Bug.md

@@ -1,3 +1,5 @@
+<!-- See available text formatting: https://gitlab.com/help/user/markdown.md -->
+
 ## Summary
 <!-- Summarize the bug encountered concisely -->
 
@@ -22,10 +24,7 @@ behavior, and link to it here in the bug report. -->
 <!-- What you should see instead -->
 
 ## Relevant logs and/or screenshots
-<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
-it's very hard to read otherwise.
-You can also use syntax highlighting for Pascal with: ```pascal  the code```
-For more information see https://docs.gitlab.com/ee/user/markdown.html -->
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code -->
 
 ## Possible fixes
 <!-- If you can, link to the line of code that might be responsible for the problem -->

+ 2 - 0
.gitlab/issue_templates/Feature Request.md

@@ -1,3 +1,5 @@
+<!-- See available text formatting: https://gitlab.com/help/user/markdown.md -->
+
 ## Summary
 <!-- Summarize the wanted feature concisely -->
 

+ 3 - 2
.gitlab/merge_request_templates/Compiler.md

@@ -1,3 +1,5 @@
+<!-- See available text formatting: https://gitlab.com/help/user/markdown.md -->
+
 ## Summary
 <!-- Summarize the changes from this merge request -->
 
@@ -14,5 +16,4 @@
 <!-- What you should see instead -->
 
 ## Relevant logs and/or screenshots
-<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
-it's very hard to read otherwise.  -->
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code -->

+ 3 - 4
.gitlab/merge_request_templates/Packages.md

@@ -1,3 +1,5 @@
+<!-- See available text formatting: https://gitlab.com/help/user/markdown.md -->
+
 ## Summary
 <!-- Summarize the changes from this merge request -->
 
@@ -8,8 +10,5 @@
 <!-- What you should see instead -->
 
 ## Relevant logs and/or screenshots
-<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
-it's very hard to read otherwise.  -->
+<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code -->
 
-<!-- automatically add a label - do not touch this area -->
-/label ~Packages

+ 12 - 2
packages/fcl-db/src/sqldb/postgres/pqconnection.pp

@@ -605,8 +605,13 @@ var
 
 begin
   tr := (trans as TPQTransactionHandle).Handle as TPGHandle;
-  tr.Used:=False; // handle can be reused after rollback (even if it failed)
   TR.RollBack;
+  FHandlePool.LockList; // protect the Used change with critical section
+  try
+    tr.Used:=False; // handle can be reused after successful rollback
+  finally
+    FHandlePool.UnLockList;
+  end;
   result := true;
 end;
 
@@ -616,7 +621,12 @@ var
 begin
   tr := (trans as TPQTransactionHandle).Handle;
   tr.Commit;
-  tr.Used:=False; // handle can be reused after successful commit
+  FHandlePool.LockList; // protect the Used change with critical section
+  try
+    tr.Used:=False; // handle can be reused after successful commit
+  finally
+    FHandlePool.UnLockList;
+  end;
   Result:=True;
 end;
 

+ 36 - 2
rtl/objpas/classes/stringl.inc

@@ -423,10 +423,44 @@ Procedure TStrings.Reverse(aList : TStrings);
 
 Var
   I : Integer;
+  lList : TStrings;
+  lOwns : boolean;
 
 begin
-  for I:=Count-1 downto 0 do
-    aList.Add(Strings[i]);
+  lOwns:=False;
+  if aList=self then
+    begin
+    lList:=Nil;
+    BeginUpdate;
+    try
+      if (self is TStringList) then
+        begin
+        lOwns:=TstringList(Self).OwnsObjects;
+        TStringList(Self).OwnsObjects:=False;
+        end;
+      lList:=TStringList.Create;
+      Reverse(lList);
+      AddStrings(lList,True);
+    finally
+      if (self is TStringList) then
+        TStringList(Self).OwnsObjects:=lOwns;
+      EndUpdate;
+      lList.Free;
+    end;
+    end
+  else 
+    begin
+    aList.BeginUpdate;
+    try
+      aList.Clear;
+      if aList.Capacity<Self.Count then
+        aList.Capacity:=Self.Count;
+      for I:=Count-1 downto 0 do
+        aList.AddObject(Strings[i],Objects[i]);
+    finally
+      aList.EndUpdate;
+    end;      
+    end;  
 end;