mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:59:09 +02:00
carbon: fix for freez if wakemainthread is called from the main thread prior to event loop initialization. #23393
git-svn-id: trunk@43469 -
This commit is contained in:
parent
99e8e0f47f
commit
2ff9c62e4a
@ -1173,6 +1173,11 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCarbonWidgetSet.OnWakeMainThread(Sender: TObject);
|
||||
begin
|
||||
// the code below would start waiting on the first app event to arrive.
|
||||
// however, if fAppLoop has not been initialized and we're in the main thread
|
||||
// we shouldn't wait for it, since signal is given from the main thread.
|
||||
if (GetThreadID=MainThreadID) and (not Assigned(fAppLoop)) then Exit;
|
||||
|
||||
// wait infinite for the first (dummy) event sent to the main event queue
|
||||
WaitFirstAppEvent;
|
||||
SendCheckSynchronizeMessage;
|
||||
|
Loading…
Reference in New Issue
Block a user