RAD Studio
ContentsIndex
PreviousUpNext
Runtime Type Identification And Destructors

When destructor cleanup is enabled, a pointer to a class with a virtual destructor can't be deleted if that class is not compiled with runtime type identification enabled. The runtime type identification and destructor cleanup options are on by default. They can be disabled from the C++ page of the Project Options dialog box, or by using the -xd- and -RT- command-line options. 

Example  

class Alpha {
public:
   virtual ~Alpha( ) { }
};
void func( Alpha *Aptr ) {
   delete Aptr;         // Error.  Alpha is not a polymorphic class type
}
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!