IDE: fixed mem leak

git-svn-id: trunk@30067 -
This commit is contained in:
mattias 2011-03-29 09:05:55 +00:00
parent 35c579cb7c
commit 333a3192c5

View File

@ -689,6 +689,7 @@ begin
TVNodeStack:=TFPList.Create; TVNodeStack:=TFPList.Create;
ExpandedState:=TTreeNodeExpandedState.Create(ItemsTreeView); ExpandedState:=TTreeNodeExpandedState.Create(ItemsTreeView);
try try
FreeTVNodeData(FFilesNode);
if LazProject<>nil then begin if LazProject<>nil then begin
// collect and sort files // collect and sort files
CurFile:=LazProject.FirstPartOfProject; CurFile:=LazProject.FirstPartOfProject;
@ -708,7 +709,6 @@ begin
//debugln(['TProjectInspectorForm.UpdateFiles filtered=',Files.Count,' of ',LazProject.FileCount,' Filter="',Filter,'" Hierachy=',ShowDirectoryHierarchy,' SortAlpha=',SortAlphabetically]); //debugln(['TProjectInspectorForm.UpdateFiles filtered=',Files.Count,' of ',LazProject.FileCount,' Filter="',Filter,'" Hierachy=',ShowDirectoryHierarchy,' SortAlpha=',SortAlphabetically]);
// update treeview nodes // update treeview nodes
FreeTVNodeData(FFilesNode);
if Files.Count=0 then if Files.Count=0 then
FFilesNode.DeleteChildren FFilesNode.DeleteChildren
else begin else begin
@ -981,15 +981,12 @@ begin
ANode:=ItemsTreeView.Items.GetFirstNode ANode:=ItemsTreeView.Items.GetFirstNode
else else
ANode:=ANode.GetFirstChild; ANode:=ANode.GetFirstChild;
while (ANode<>nil) and (ANode.Text<>CurText) do while ANode.Text<>CurText do ANode:=ANode.GetNextSibling;
ANode:=ANode.GetNextSibling;
if ANode=nil then break; if ANode=nil then break;
ASelection.Delete(0); ASelection.Delete(0);
end; end;
if ANode<>nil then if ANode<>nil then ItemsTreeView.Selected:=ANode;
ItemsTreeView.Selected:=ANode; if FreeList then ASelection.Free;
if FreeList then
ASelection.Free;
end; end;
constructor TProjectInspectorForm.Create(TheOwner: TComponent); constructor TProjectInspectorForm.Create(TheOwner: TComponent);