mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-03 23:23:46 +02:00
TAChart: Fix silent exception EAbort in TBroadcaster. Issue #35210, patch by Marcin Wiazowski.
git-svn-id: trunk@60801 -
This commit is contained in:
parent
c53612413e
commit
23473d15d0
@ -847,6 +847,7 @@ procedure TBroadcaster.Broadcast(ASender: TObject);
|
|||||||
var
|
var
|
||||||
ListCopy: array of Pointer;
|
ListCopy: array of Pointer;
|
||||||
Exceptions: TStringList;
|
Exceptions: TStringList;
|
||||||
|
Aborted: Boolean;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
if Locked then exit;
|
if Locked then exit;
|
||||||
@ -860,12 +861,16 @@ begin
|
|||||||
ListCopy[i] := List^[i];
|
ListCopy[i] := List^[i];
|
||||||
|
|
||||||
Exceptions := nil;
|
Exceptions := nil;
|
||||||
|
Aborted := False;
|
||||||
try
|
try
|
||||||
for i := 0 to High(ListCopy) do
|
for i := 0 to High(ListCopy) do
|
||||||
try
|
try
|
||||||
TListener(ListCopy[i]).Notify(ASender);
|
TListener(ListCopy[i]).Notify(ASender);
|
||||||
except
|
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
|
if not Assigned(Exceptions) then begin
|
||||||
Exceptions := TStringList.Create;
|
Exceptions := TStringList.Create;
|
||||||
Exceptions.Duplicates := dupIgnore;
|
Exceptions.Duplicates := dupIgnore;
|
||||||
@ -876,6 +881,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
if Assigned(Exceptions) then
|
if Assigned(Exceptions) then
|
||||||
raise EBroadcasterError.Create(Trim(Exceptions.Text));
|
raise EBroadcasterError.Create(Trim(Exceptions.Text));
|
||||||
|
if Aborted then
|
||||||
|
Abort;
|
||||||
finally
|
finally
|
||||||
Exceptions.Free;
|
Exceptions.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user