WARN15-Constructors/destructors without calls to inherited

Top  Previous  Next

 

Constructors/destructors without calls to inherited (WARN15)

 

This is a list of all constructors and destructors that never call their inherited constructor/destructor. This call is often required. so that the object can be correctly created or destroyed. For a class descending directly from TObject, the inherited call in the constructor is not needed, since the constructor in TObject does not actually do anything. There is no guarantee though that the constructor will be empty in future versions. If the constructor/destructor does not call inherited itself, but calls another constructor/destructor that calls inherited, there will be no warning.

 

Recommendation:

Call the inherited constructor as the first statement in the constructor, and as the last statement in the destructor.

 

 

See also:

 

Alerts