Destructors

Top  Previous  Next

What is translated > Destructors

 

In Delphi a declaration of destructors start with the keyword destructor followed  by an arbitrary name. In C++ the name of the of the class is also the name of the destructor preceded by the the character '~'.

 

destructor classname.foo;    ->   __fastcall classname::~classname ( )

 

 

Delphi2Cpp tempts to find calls of destructors of the base class and to comment them out in C++. Thereby is assumed that the destructor of the base class is virtual. This has to be checked by the user.

 

 

destructor foo.Destroy();   ->    __fastcall foo::~foo ( )

begin                             {                                                           

  FreeAndNil(m_Messages);           FreeAndNil ( m_Messages );                               

  inherited Destroy;                // todo check:  inherited::Destroy;                  

end;  

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content