From 33e2771302711f8e81044e670257e3cfb825f037 Mon Sep 17 00:00:00 2001 From: Dark Byte Date: Fri, 21 Jun 2019 23:34:46 +0200 Subject: [PATCH] set the OnDestroy event --- Cheat Engine/diagram.pas | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Cheat Engine/diagram.pas b/Cheat Engine/diagram.pas index 18cc035737..b186240fcf 100644 --- a/Cheat Engine/diagram.pas +++ b/Cheat Engine/diagram.pas @@ -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 @@ -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;