From a012c5158d34d34cb42e807c2636cd56976323bb Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 27 Apr 2019 17:26:49 +0000 Subject: [PATCH] jvcllaz: Fix TJvDBTreeView and TJvDBLookupTreeView crashing the IDE when they are deleted from the form. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6871 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/run/JvDB/JvDBTreeView.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/jvcllaz/run/JvDB/JvDBTreeView.pas b/components/jvcllaz/run/JvDB/JvDBTreeView.pas index beb536ffd..3b8109827 100644 --- a/components/jvcllaz/run/JvDB/JvDBTreeView.pas +++ b/components/jvcllaz/run/JvDB/JvDBTreeView.pas @@ -1581,7 +1581,9 @@ var strLength: Integer; HasChildren: Byte; begin - if Items.Count > 0 then + // wp: not clear if this still works correctly: had to add "Assigned(Items)" + // to prevent crash when destroying + if Assigned(Items) and (Items.Count > 0) then begin // save master values into stream FMastersStream := TMemoryStream.Create;