Reputation: 1324
When a Delphi timer executes, is it not in the main thread?
procedure TMainForm.MyTimerTimer(Sender: TObject);
begin
MyModalDialog.StatusText.BeginUpdate;
MyModalDialog.StatusText.Text := 'timer fired...';
MyModalDialog.StatusText.EndUpdate;
end;
I am wondering if crashes here are due to updating the GUI elements outside of the main thread.
Upvotes: 0
Views: 280
Reputation: 12322
The timer event handler execute in the context of the thread having created it. Usually it is the main thread but you can create a timer within any thread.
Upvotes: 4
Reputation: 12837
The timer will execute on the main thread. No need to worry about using Synchronize().
Upvotes: 1