Skip to content

Commit

Permalink
set the OnDestroy event
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jun 21, 2019
1 parent ee6f9b4 commit 33e2771
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Cheat Engine/diagram.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,8 @@ procedure TDiagram.loadFromStream(s: TStream);
var
i: integer;
c: integer;
b: TDiagramBlock;
l: TDiagramLink;
begin
if s.ReadAnsiString<>'CEDIAG' then raise exception.create('Invalid diagram file');
if s.ReadWord>diagramversion then
Expand All @@ -1305,11 +1307,19 @@ procedure TDiagram.loadFromStream(s: TStream);

c:=s.ReadDWord;
for i:=0 to c-1 do
blocks.add(TDiagramBlock.createFromStream(diagramConfig, s));
begin
b:=TDiagramBlock.createFromStream(diagramConfig, s);
blocks.add(b);
b.OnDestroy:=@NotifyBlockDestroy;
end;

c:=s.ReadDWord;
for i:=0 to c-1 do
links.add(TDiagramLink.createFromStream(diagramconfig, s, blocks));
begin
l:=TDiagramLink.createFromStream(diagramconfig, s, blocks);
links.add(l);
l.OnDestroy:=@NotifyLinkDestroy;
end;

RepaintOrRender;
end;
Expand Down

0 comments on commit 33e2771

Please sign in to comment.