Article View: borland.public.cppbuilder.nativeapi
Article #17062Re: Fixing a memory leak
From: Terry
Date: Fri, 11 Apr 2003 20:15
Date: Fri, 11 Apr 2003 20:15
20 lines
1424 bytes
1424 bytes
Thanks JD, let me give it a shot.
"JD" <nospam@nospam.com> wrote in message
news:3e970049$1@newsgroups.borland.com...
>
> Try this:
>
> PeopleType *People = (PeopleType*) ReadFileToBuffer
"Database.dat", &FileSize);
> if( People )
> {
> // use People;
> delete People;
> }
>
> BTW: It is permissable to delete a NULL pointer in C++
>
> ~ JD
>
Technical Details
Message-ID:
<3e972269$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e96fe40$1@newsgroups.borland.com> <3e970049$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,23a77f481a630239 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-11 13:25:52 PST Reply-To: "Terry" <terry@helloworld.com> From: "Terry" <terry@helloworld.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e96fe40$1@newsgroups.borland.com> <3e970049$1@newsgroups.borland.com> Subject: Re: Fixing a memory leak Date: Fri, 11 Apr 2003 15:15:52 -0500 Lines: 22 Organization: here X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 66.142.144.216 Message-ID: <3e972269$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1050092137 66.142.144.216 (11 Apr 2003 13:15:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail