mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-07 05:10:52 +01:00
* use a try..finally block to protect against memory leaks if the comparison
callback function raises an exception in QuickSort_ItemList_Context git-svn-id: trunk@41228 -
This commit is contained in:
parent
e5492d8992
commit
de80621e1e
@ -237,8 +237,11 @@ begin
|
||||
if not Assigned(Items) or (ItemCount < 2) or (ItemSize < 1) then
|
||||
exit;
|
||||
GetMem(TempBuf, ItemSize);
|
||||
QuickSort(0, ItemCount - 1);
|
||||
FreeMem(TempBuf, ItemSize);
|
||||
try
|
||||
QuickSort(0, ItemCount - 1);
|
||||
finally
|
||||
FreeMem(TempBuf, ItemSize);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure QuickSort_ItemList_CustomItemExchanger_Context(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user