Stack Overflow on FormCreate

Have what I believe to be an uncomplicated VCL form. It needs to call the constructor of a used unit. I placed the constructor call in the OnCreate event of the form. Dproj file contains a single call to Application.CreateForm(...), followed by Application.Run.

Execution gives a stack overflow error. Debug tracking reveals that the OnCreate method is called over and over, resulting (I guess) in the stack overflow.

I cannot be sure what the origin of this specific error is, however, two problems stand out. You define these two methods

Code:

Constructor Init;
Destructor Free;

A constructor is a method to create the object that that method is part of. You are creating another object within the Init method, but you are not creating the form itself (A constructor defined within the form's declaration would be to create the form). Change Constructor Init to Procedure Init.

A Destructor is also to destroy the object that the method is part of. Your form already has a destructor. Get rid of this declaration altogether, and the object that you are freeing in this destructor can be freed in the form's OnClose event.