|Subject:||Re: Proper way to close an application containing TIdHTTPServer?|
|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Tue, 12 Jul 2005|
"Andrew Fiddian-Green" <nn@dd> wrote in message
> I suppose that in MainForm OnCloseQuery one could set the
> server active := false and then wait until all threads are done.
You could. Though keep in mind that there are situations where the
OnCloseQuery event is not triggered to begin with. OnClose might be better
to use. Or you could not do anything at all, since TIdHTTP shuts everything
down anyway when it is being freed.
> But how can I know when all the threads are done?
The setter method of the Active propety does not return to your code until
all threads have been terminated.
Proper way to close an application containing TIdHTTPServer? posted by Andrew Fiddian-Green on Tue, 12 Jul 2005