Deleting anonymous instances

In IBM® Rational® Rhapsody®, you manage anonymous instances yourself. As a result, it is your responsibility to delete them. Components of composite instances are managed by the composite. To delete them, you must make an explicit request of the composite object.

About this task

Apply the C++ delete operator as in any conventional C++ program. Deletion of instances involves applying the destructor of that instance. The product generates a default destructor for every class in the system. You can add code to the destructor through the browser.

For example, to delete an instance pointed to by aB, use the following call:

   delete aB;

Feedback