The CheckPointer() function is used for checking the type of the object pointer. The function returns a value of the ENUM_POINTER_TYPE enumeration. If an incorrect pointer is used, the program execution will be immediately terminated.
Objects created by the new() operator are of POINTER_DYNAMIC type. The delete() operator can and should be used only for such pointers.
All other pointers are of POINTER_AUTOMATIC type, which means that this object has been created automatically by the mql5 program environment. Such objects are deleted automatically after being used.
Pointer of the object created by the new() operator
Pointer of any objects created automatically (not using new())