Article View: borland.public.cppbuilder.nativeapi
Article #12704Re: Does an error (WinAPI) has to be freed?
From: Jonathan Arnold
Date: Fri, 21 Nov 2003 14:33
Date: Fri, 21 Nov 2003 14:33
27 lines
2249 bytes
2249 bytes
David Scheffel wrote:
> I found quite a few errors in MemProof that are not freed after my
> application is closed. That's what MemProof says. So do I have to free these
> errors that are stored in the WinAPI, or is this a bug in MemProof?
Win32 is very forgiving in that regard. When you program ends, all
resources and memory are freed up for you. Two concerns:
1] If it is some memory that is constantly being allocated and not
freed, your program can use up all available physical memory and
start paging off to the hard disk - bad.
2] If your program some day turns into a DLL, that memory won't be
freed until the calling program exits, not just when the DLL exits.
So if you allocate some memory on startup and then never re-allocate, and
don't free it, you are probably pretty safe. But there still shouldn't
be any reason for your app to not free up any resources or memory it
uses. There are some memory leaks in the VCL & RTL, but there's not
much you can do about that.
--
Jonathan Arnold C/C++/CBuilder Keen Advice:
http://www.keen.com/categories/categorylist_expand.asp?sid=5156620
Comprehensive C++Builder link site:
http://www.buddydog.org/C++Builder/c++builder.html
Technical Details
Message-ID:
<3fbe2230$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fbe06cb$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,3849b2b2d874747b X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-21 06:40:40 PST Date: Fri, 21 Nov 2003 09:33:20 -0500 From: Jonathan Arnold <jdarnold@buddydog.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031030 MultiZilla/1.5.0.3l X-Accept-Language: en-us, en, ja MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Does an error (WinAPI) has to be freed? References: <3fbe06cb$1@newsgroups.borland.com> In-Reply-To: <3fbe06cb$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.92.76.225 Message-ID: <3fbe2230$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069425200 66.92.76.225 (21 Nov 2003 06:33:20 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail