From 1a362baf8c4e424fd0d62c75059ed69e8634d027 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Mon, 21 Sep 2015 01:42:49 +0200 Subject: [PATCH] fix, possible av on close --- src/ce_messages.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ce_messages.pas b/src/ce_messages.pas index f7933823..7c6af107 100644 --- a/src/ce_messages.pas +++ b/src/ce_messages.pas @@ -325,6 +325,7 @@ destructor TCEMessagesWidget.destroy; begin fToDemangle.Free; fToDemangleObjs.Free; + fToDemangleObjs := nil; freeDemangler; fOptions.saveToFile(getCoeditDocPath + optname); EntitiesConnector.removeObserver(self); @@ -337,9 +338,12 @@ var begin if node.Data <> nil then Dispose(PMessageData(Node.Data)); - i := fToDemangleObjs.IndexOf(node); - if i <> -1 then - fToDemangleObjs.Items[i] := nil; + if fToDemangleObjs <> nil then + begin + i := fToDemangleObjs.IndexOf(node); + if i <> -1 then if i < fToDemangleObjs.Count then + fToDemangleObjs.Items[i] := nil; + end; end; procedure TCEMessagesWidget.ListKeyDown(Sender: TObject; var Key: Word;