What I mean: do I need to call 'Close' before 'Free'?
It seems to make no difference, if I skip 'Close' before 'Free'.
Does 'Close' anything, that is neccecary before 'Free'? (all this for non modal Forms with no OnCloseQuery- or OnClose-Event)
First, I'll try to answer your question directly.
If the conditions you set are satisfied, there is no code in OnClose or OnCloseQuery (apart from setting CloseAction to caHide), so the only thing Close will do to a non-modal form is hide it, which doesn't make an actual difference if you are freeing the form immediately after it.
In short - it doesn't make a difference if you skip Close before Free.
Now, although I believe it was the full answer to your question, there is something else I think that should be said here.
There is a situation when you should not call Form.Free directly.
That situation is when the call to Free (or destroy) is made inside some event handler of the form (or event of some component whose owner is the form) -- then the form object might be accessed internally after this event, so the form needs to live a bit longer, until the whole event processing has finished.
Hence, immediate destroying from inside the handler might lead to access violation. In such cases you should call
Release method, instead of directly calling Destroy or Free. Calling Release makes sure that all event handlers are processed and only then the form is actually destroyed.
That is why Close method (when CloseAction is caFree) does not call Destroy or Free, but it calls Release.
So, calling Close (which means Hide) before Free is never necessary or useful, but Close with caFree (which means Release)
instead of Free might be a better option for destroying the form than calling Free. Note that in this situation, if you call Release (or Close) and then Free immediately after it, you can still get AV -- Release scheduled destroying, but you destroyed it too early nevertheless! -- so, from inside the event handler of the Form, don't call Release (or Close)
before Free, but call it
instead of Free.
Again, calling Form.Free directly is safe unless it is called from inside some event handler of the Form or an event handler of a component owned by this form.