LazMapViewer: Fixed recursive loop when loading TMapView component with UseThreads=true.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9551 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alpine-a110 2024-12-25 22:40:12 +00:00
parent 8457b3b34a
commit 200f5209e3

View File

@ -684,7 +684,7 @@ var
begin begin
TimeOut := 0; TimeOut := 0;
mThread := IsMainThread; mThread := IsMainThread;
if FUseThreads then if FUseThreads and (Length(lstJob) > 0) then
begin begin
repeat repeat
OneFound := False; OneFound := False;
@ -701,13 +701,15 @@ begin
finally finally
LeaveCriticalSection; LeaveCriticalSection;
end; end;
if OneFound and (TimeOut > 200) then
raise Exception.Create('TimeOut');
if mThread then
Application.ProcessMessages;
if OneFound then if OneFound then
begin
if (TimeOut > 200) then
raise Exception.Create('TimeOut');
if mThread then
Application.ProcessMessages;
Sleep(100); Sleep(100);
Inc(TimeOut); Inc(TimeOut);
end;
until not OneFound; until not OneFound;
end; end;
end; end;