Hi.
Is there a way to pre-maturely halt TCustomApplication without causing memory leaks?
Say, I have a code, where TH is a Class(TCustomApplication):
ph := TH.Create(Nil);
ph.Initialize;
ph.ProcessOptions;
ph.Run;
ph.Free;When options are processed, it may happen the program needs to halt, when provided with improper parameters, for example. In such a case, I would call Help method:
Procedure TH.Help(ExitCode : Byte = 0; ErrStr : String = '');
Begin
{ do stuff }
Halt(ExitCode);
End;Now, when this happens, ph is not freed, causing a minor memory leak. I don't want that. Is there a way to terminate a program with Halt but also making sure the memory has been freed properly?
Thanks.
Łukasz
