Jaa


Best Practice for Destructors (finalize)

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

The X++ language has no destructor method. A destructor method is one that is called by the system when there are no more references to an object and the system starts to destroy the object.

The Object class has a finalize method, but finalize is empty and the Microsoft Dynamics AX system never calls it. You can override the finalize method if you want a method to contain code that might otherwise belong in a destructor method. However, finalize is not called unless your code calls it explicitly.

See also

Best Practices for Class Declarations

Best Practices for Constructors

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.