mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 14:09:15 +02:00
* Fix issue #40180
This commit is contained in:
parent
d5807e03b6
commit
08821f9422
@ -1555,11 +1555,12 @@ begin
|
||||
ResultName := CompName;
|
||||
Lock;
|
||||
try
|
||||
while Assigned(FindGlobalComponent(ResultName)) do
|
||||
begin
|
||||
Inc(i);
|
||||
ResultName := CompName + '_' + IntToStr(i);
|
||||
end;
|
||||
if ResultName<>'' then
|
||||
while Assigned(FindGlobalComponent(ResultName)) do
|
||||
begin
|
||||
Inc(i);
|
||||
ResultName := CompName + '_' + IntToStr(i);
|
||||
end;
|
||||
Result.Name := ResultName;
|
||||
finally
|
||||
Unlock;
|
||||
|
Loading…
Reference in New Issue
Block a user