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:
dmitry 2013-11-21 05:08:08 +00:00
parent 99e8e0f47f
commit 2ff9c62e4a

View File

@ -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;