I create a components at run time such as Memos, labes, and even forms. I make the owner and parent of these component a Form. When I close this form (Not a main form) I free all component that I was created at run-time, but when I close the main form and my application terminated (And when the owner of these component destroyed) Access violation exception alwyas raised.
I think the owner only who must destroy it's components, and when it find it is already destroyed it will rais the exception. In my application I need to destroy that component when I close that form, and I create new ones when I open that form again.
The only thing that I can do now is to assign Visible property of these components to False when I close the form, it works very well but the problem is that will consume memory resource. Is there any safe freeing for such components?