🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2508

Re: Memory Leak - TForm or TStringGrid or DynamicArray

#2508
From: Alan Bellingham
Date: Fri, 09 Feb 2007 08:41
20 lines
1860 bytes
"Ed Mulroy" <dont_email_me@bitbuc.ket> wrote:

>> ...I've said this before, and I'll say it again - if I see a delete
>> in user code, I consider it a warning sign that the code is
>> probably unsafe...
>
>     std::auto_ptr<char> Foo(new char[26]);
>
>As the old saying goes, "all full generalizations are wrong, including this 
>one" <g>

Well, I didn't add the 'new considered unsafe' too, did I *grin*

That one is best replaced by std::vector<char> Foo(26).

Alan Bellingham
-- 
Team Thai Kingdom
<url:http://www.borland.com/newsgroups/> Borland newsgroup descriptions
<url:http://www.borland.com/newsgroups/netiquette.html>      netiquette
Technical Details
Message-ID: <0scos2d8fs92eis2eo0a7j91shnaaedbrd@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c7810f@newsgroups.borland.com> <45c7dc8d$1@newsgroups.borland.com> <45c89ec6@newsgroups.borland.com> <45ca4546$1@newsgroups.borland.com> <0sqks2t4c90epuc62bv635h36cqeat0ujd@4ax.com> <45cb3451$1@newsgroups.borland.com> <ptems2p2k2rquqdiao805ik2fhg6jl9n9a@4ax.com> <45cbc696$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,191a7d21d69bde32
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Memory Leak - TForm or TStringGrid or DynamicArray
Date: Fri, 09 Feb 2007 08:41:46 +0000
Reply-To: alanb@episys.com
Message-ID: <0scos2d8fs92eis2eo0a7j91shnaaedbrd@4ax.com>
References: <45c7810f@newsgroups.borland.com> <45c7dc8d$1@newsgroups.borland.com> <45c89ec6@newsgroups.borland.com> <45ca4546$1@newsgroups.borland.com> <0sqks2t4c90epuc62bv635h36cqeat0ujd@4ax.com> <45cb3451$1@newsgroups.borland.com> <ptems2p2k2rquqdiao805ik2fhg6jl9n9a@4ax.com> <45cbc696$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 4.1/32.1088
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.49.31.105
X-Trace: newsgroups.borland.com 1171010501 62.49.31.105 (9 Feb 2007 00:41:41 -0800)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail