Why is there no automation in releasing the memory automatically during the termination of the program? - Delphi

Why is there no automation in releasing the memory automatically during the termination of the program?



- Delphi uses lots of methods to do the automatic releasing of the memory like implementing the objects by reference.

- Objects by reference allow the memory to be freed when the object is terminated or the function of it finishes.

- The object can be declared through reference as:

var
hello : TMy;

- This way the reference of an object is created and then the object for this reference can be created as:

begin
hello := TMy.Create;

- The memory is allocated for the object by Delphi and then the create constructor method is executed to initialize the object if required.

- The hello variable is used to point to the new object and then it is referenced.
Post your comment