Re: [Dev-C++] Memory leak with STL list erase
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Mikael L. <cbt...@ma...> - 2004-03-23 02:03:44
|
Alessandro Bugatti wrote: > Hi, > I tried to use the STL list in order to insert and erase some element, > but if I look to the memory usage of my program it seems when I erase > elements the memory occupation it is the same (also if I use clear()). > > [snip] Since you create your elements with new, you'll have to call delete on them yourself. Either that or use a smart-pointer class. -Mikael Lax |