mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 06:39:26 +02:00
ide: fix memory leak if lpi contains duplicates for units and show unit dialog was shown
git-svn-id: trunk@19408 -
This commit is contained in:
parent
9e7ee42ccf
commit
1c8d3ab9b0
@ -7757,9 +7757,9 @@ begin
|
|||||||
if (Project1.Units[i].FileName <> '') then
|
if (Project1.Units[i].FileName <> '') then
|
||||||
begin
|
begin
|
||||||
UnitName := ExtractFileName(Project1.Units[i].Filename);
|
UnitName := ExtractFileName(Project1.Units[i].Filename);
|
||||||
|
if ItemList.IndexOf(UnitName) = -1 then
|
||||||
ItemList.AddObject(UnitName,
|
ItemList.AddObject(UnitName,
|
||||||
TViewUnitsEntry.Create(UnitName, i,
|
TViewUnitsEntry.Create(UnitName, i, Project1.Units[i] = ActiveUnitInfo));
|
||||||
Project1.Units[i] = ActiveUnitInfo));
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Project1.MainUnitID = i then
|
if Project1.MainUnitID = i then
|
||||||
@ -7768,7 +7768,7 @@ begin
|
|||||||
if pfMainUnitIsPascalSource in Project1.Flags then
|
if pfMainUnitIsPascalSource in Project1.Flags then
|
||||||
begin
|
begin
|
||||||
UnitName := ExtractFileName(MainUnitInfo.Filename);
|
UnitName := ExtractFileName(MainUnitInfo.Filename);
|
||||||
if UnitName <> '' then
|
if (UnitName <> '') and (ItemList.IndexOf(UnitName) = -1) then
|
||||||
begin
|
begin
|
||||||
ItemList.AddObject(UnitName,
|
ItemList.AddObject(UnitName,
|
||||||
TViewUnitsEntry.Create(UnitName, i, MainUnitInfo = ActiveUnitInfo));
|
TViewUnitsEntry.Create(UnitName, i, MainUnitInfo = ActiveUnitInfo));
|
||||||
|
Loading…
Reference in New Issue
Block a user