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

View File

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