|
Constructor result not assigned
A problem that can occur is the loss of a pointer to an object you have created.
For example:
Form.Create(self);
This is a perfectly valid statement however, depending on your programming style, it may result in memory loss or exception errors later in your program.
Perhaps it should read:
Form:=TForm.Create(self);//now Form is a pointer to the TForm class
It is possible that this is a valid statement if the constructor of Form keeps a pointer to itself (such as by setting a parent property or adding itself to a collection of objects). It is for this reason that this warning is switched off by default. It can be enabled in the Options screen. Otherwise for some projects it might produce hundreds of warnings for valid constructors.
Enable or disable this option depending on the programming style of your project.
< Back to list of hints and warnings
|