🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Fixing a memory leak

#17059
From: JD
Date: Fri, 11 Apr 2003 17:50
13 lines
1124 bytes
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: <3e970049$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!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
References: <3e96fe40$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 10:54:27 PST
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: Fixing a memory leak
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 172.146.49.127 172.146.49.127    
References:  <3e96fe40$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3e970049$1@newsgroups.borland.com>
Date: 11 Apr 2003 10:50:01 -0700
X-Trace: newsgroups.borland.com 1050083401 207.105.83.65 (11 Apr 2003 10:50:01 -0700)
Lines: 14
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!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