Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: Is it ok for a form to free it self?

I have a form that I use to show some information for some seconds. Is it ok for the form to free itself? Can I start a timer in the constructor, and then call self.free in the timer-event? Or will this potentially lead to trouble?

like image 337
Vegar Avatar asked Apr 02 '09 08:04

Vegar


1 Answers

In addition, with a form you can call Release.

It sends a CM_RELEASE message to the form. As a reaction it calls Free. The advantage of release is that there are no messages left for the form which could result in a crash.

like image 144
Toon Krijthe Avatar answered Oct 24 '22 09:10

Toon Krijthe