Using
delete on a pointer to an object not allocated with new gives unpredictable results. ... When
delete is used to deallocate memory for a
C++ class object, the object's destructor is called before the object's memory is deallocated (if the object has a destructor).
read more >>