Re: [Dev-C++] Memory leak with STL list erase
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Hossein H. <ult...@em...> - 2004-03-27 14:10:49
|
<P>Mikael,<BR><BR>> Since you create your elements with new, you'll have to call delete on <BR>> them yourself. Either that or use a smart-pointer class. <BR><BR>A big mistake! Never, ever, ever use auto_ptr<> in containers. auto_ptr<> hasn't got first-order variable semantics. For more stuff consult "Effective STL" by Scott Meyers.<BR><BR>Regards,<BR>--Hossein</P><BR> -- <p>__________________________________________________________<br> Sign-up for Ads Free at Mail.com<br> <a href="http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode=adsfreejump01" target="_blank">http://www.mail.com/?sr=signup</a></p> |