Search code examples
lazarusfreepascal

What does the `free` method from TProcess do?


What does the free method do in TProcess. It's used in several examples I found on the net but there's nothing in the reference about it? So far I used it and everything works fine. Can I continue to use it or should I use a different method?


Solution

  • It is the Free method defined in TObject, at the very root of the class hierarchy. This method does the same thing in every single class, there is nothing special with TProcess in this regard.

    It is documented:

    Free will check the Self pointer and calls Destroy if it is different from Nil. This is a safer method than calling Destroy directly.