🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Does an error (WinAPI) has to be freed?

#12706
From: David Scheffel
Date: Fri, 21 Nov 2003 16:13
40 lines
2696 bytes
Thanks. Now I have a brief idea of what might be wrong with the skinning
components I bought. MemProof reported errors like:

- DeleteObject: The parameter is invalid
- DeleteObject: There's not enough memory [....]
- DeleteObject: Unknown Win 32 error

I belive that my skinning components are unable to free that memory. And
since windows does that for them when the application is closed, nobody
noticed this leak at the first sight.

"Jonathan Arnold" <jdarnold@buddydog.org> wrote:
> 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: <3fbe39af$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-mail
References: <3fbe06cb$1@newsgroups.borland.com> <3fbe2230$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 08:41:03 PST
From: "David Scheffel" <david.scheffel@schlund.de>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fbe06cb$1@newsgroups.borland.com> <3fbe2230$1@newsgroups.borland.com>
Subject: Re: Does an error (WinAPI) has to be freed?
Date: Fri, 21 Nov 2003 17:13:33 +0100
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 212.227.35.73
Message-ID: <3fbe39af$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069431215 212.227.35.73 (21 Nov 2003 08:13:35 -0700)
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