* fix for carbon Synchronize method, pointer by Roland Turcan

git-svn-id: trunk@19554 -
This commit is contained in:
dmitry 2009-04-21 14:06:02 +00:00
parent 9d8131f5d6
commit 9cab9d518c
2 changed files with 10 additions and 0 deletions

View File

@ -157,6 +157,9 @@ uses
Buttons, StdCtrls, PairSplitter, ComCtrls, Calendar, Arrow,
Spin, ExtCtrls, FileCtrl, LResources;
var
FirstAppEventLock: pEventState = nil;
// the implementation of the utility methods
{$I carbonobject.inc}
// the implementation of the winapi compatibility methods
@ -167,10 +170,14 @@ uses
procedure InternalInit;
begin
FirstAppEventLock:=BasicEventCreate(nil, true, false, '');
end;
procedure InternalFinal;
begin
basiceventSetEvent(FirstAppEventLock);
basiceventdestroy(FirstAppEventLock);
FirstAppEventLock:=nil;
end;

View File

@ -431,6 +431,7 @@ begin
then
RaiseGDBException('TCarbonWidgetSet.AppRun post dummy event failed');
fMainEventQueue:=CurMainEventQueue;
basiceventSetEvent(FirstAppEventLock);
RunApplicationEventLoop;
finally
@ -924,6 +925,8 @@ end;
------------------------------------------------------------------------------}
procedure TCarbonWidgetSet.OnWakeMainThread(Sender: TObject);
begin
// wait infinite for the first (dummy) event sent to the main event queue
basiceventWaitFor(-1, FirstAppEventLock);
SendCheckSynchronizeMessage;
end;