MQL4 Reference Language Basics Operators Object Delete Operator delete

Object Delete Operator delete

The delete operator deletes an object created by the new operator, calls the corresponding class destructor and frees up memory occupied by the object. A real descriptor of an existing object is used as an operand. After the delete operation is executed, the object descriptor becomes invalid.


      //--- delete figure
      delete m_shape;
      //--- create a new figure

See also

Initialization of Variables, Visibility Scope and Lifetime of Variables, Creating and Deleting Objects