mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:29:38 +02:00
LCL: comments
git-svn-id: trunk@26487 -
This commit is contained in:
parent
c92522b37c
commit
0170b10fea
@ -1142,7 +1142,8 @@ type
|
|||||||
Top, Last: PAsyncCallQueueItem;
|
Top, Last: PAsyncCallQueueItem;
|
||||||
end;
|
end;
|
||||||
TAsyncCallQueues = record
|
TAsyncCallQueues = record
|
||||||
Cur, Next: TAsyncCallQueue;
|
Cur: TAsyncCallQueue; // currently processing
|
||||||
|
Next: TAsyncCallQueue; // new calls added to this queue
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TApplicationType = (
|
TApplicationType = (
|
||||||
|
@ -994,7 +994,7 @@ var
|
|||||||
Data: PtrInt;
|
Data: PtrInt;
|
||||||
begin
|
begin
|
||||||
with FAsyncCall do begin
|
with FAsyncCall do begin
|
||||||
// move the items of NextQueue to CurQueue
|
// move the items of NextQueue to CurQueue, keep the order
|
||||||
if Next.Top<>nil then
|
if Next.Top<>nil then
|
||||||
begin
|
begin
|
||||||
if Cur.Last<>nil then
|
if Cur.Last<>nil then
|
||||||
@ -1011,21 +1011,24 @@ begin
|
|||||||
Next.Last:=nil;
|
Next.Last:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// only process items from last to top in current queue
|
// process items from top to last in 'Cur' queue
|
||||||
// this can create new items, which are added to the next queue
|
// this can create new items, which are added to the 'Next' queue
|
||||||
// or it can call ProcessAsyncCallQueue, for example via calling
|
// or it can call ProcessAsyncCallQueue, for example via calling
|
||||||
// Application.ProcesssMessages
|
// Application.ProcesssMessages
|
||||||
while Cur.Top <> nil do
|
while Cur.Top <> nil do
|
||||||
begin
|
begin
|
||||||
|
// remove top item from queue
|
||||||
lItem:=Cur.Top;
|
lItem:=Cur.Top;
|
||||||
Cur.Top := lItem^.NextItem;
|
Cur.Top := lItem^.NextItem;
|
||||||
if Cur.Top = nil then
|
if Cur.Top = nil then
|
||||||
Cur.Last := nil
|
Cur.Last := nil
|
||||||
else
|
else
|
||||||
Cur.Top^.PrevItem := nil;
|
Cur.Top^.PrevItem := nil;
|
||||||
|
// free item
|
||||||
Event:=lItem^.Method;
|
Event:=lItem^.Method;
|
||||||
Data:=lItem^.Data;
|
Data:=lItem^.Data;
|
||||||
Dispose(lItem);
|
Dispose(lItem);
|
||||||
|
// call event
|
||||||
Event(Data);
|
Event(Data);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user