On Thu, 24 Feb 2011 15:36:17 +0200 Wimpie Nortje <wimpienor...@gmail.com> wrote:
> Hi everybody, > > The manual (possibly Delphi one) says that TThread.OnTerminate executes > in the GUI thread. This is easy if the GUI thread owns the TThread. > > Suppose the GUI owns a TTHread which owns a subthread. In which context > does the subthread's OnTerminate execute? Under unix OnTerminate is always called in the main thread: procedure TThread.CallOnTerminate; begin // no need to check if FOnTerminate <> nil, because // thats already done in DoTerminate FOnTerminate(self); end; procedure TThread.DoTerminate; begin if Assigned(FOnTerminate) then Synchronize(@CallOnTerminate); end; Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal