If someone wants to reopen an object that already has an open form I want to bring it to the front, otherwise, open a new form for that object.
I usually just loop through the
TScreen.Forms list looking if the desired Form already exists, if so then
Show() it, otherwise create a new instance.
I have tried keeping a list of the forms but because the list exists the closed forms never gets freed.
Why would that be? Objects are not reference counted, so just keeping a list of object pointers would not prevent those objects from being destroyed. Closing a Form does not auto-destroy it, though. You need to set
CloseAction=caFree in the Form's
OnClose event if you want that behavior.