TAChart: Fix silent exception EAbort in TBroadcaster. Issue #35210, patch by Marcin Wiazowski.

git-svn-id: trunk@60801 -
This commit is contained in:
wp 2019-03-31 10:44:36 +00:00
parent c53612413e
commit 23473d15d0

View File

@ -847,6 +847,7 @@ procedure TBroadcaster.Broadcast(ASender: TObject);
var
ListCopy: array of Pointer;
Exceptions: TStringList;
Aborted: Boolean;
i: Integer;
begin
if Locked then exit;
@ -860,12 +861,16 @@ begin
ListCopy[i] := List^[i];
Exceptions := nil;
Aborted := False;
try
for i := 0 to High(ListCopy) do
try
TListener(ListCopy[i]).Notify(ASender);
except
on E: Exception do begin
on E: Exception do
if E is EAbort then
Aborted := true
else begin
if not Assigned(Exceptions) then begin
Exceptions := TStringList.Create;
Exceptions.Duplicates := dupIgnore;
@ -876,6 +881,8 @@ begin
end;
if Assigned(Exceptions) then
raise EBroadcasterError.Create(Trim(Exceptions.Text));
if Aborted then
Abort;
finally
Exceptions.Free;
end;