Leak 1

 <  Free Open Study  >  

Leak #1

Mismatched new/delete calls in the constructor and destructor of a class. The obvious case of C++ memory leakage occurs when a developer dynamically allocates memory via new and forgets to explicitly clean up that memory with a call to delete . This can occur when an object is created on the heap and not explicitly cleaned up or, more commonly, when the constructor of a class dynamically allocates memory but the destructor is either absent or not cleaning up the object correctly. An example of the former case is shown here.

 <  Free Open Study  >  


Object-Oriented Design Heuristics
Object-Oriented Design Heuristics (paperback)
ISBN: 0321774965
EAN: 2147483647
Year: 1996
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net