🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7874

Re: Freeing memory in #pragma exit

#7874
From: Derick J.R. Qua-Gonzalez
Date: Thu, 07 Sep 1995 07:32
24 lines
1434 bytes
wcw@wolfe.net (William White) writes:

>	Is it better to free all allocated memory from new &
>malloc()...  by freeing it with a #pragma exit function, or a regular
>function just before exit() is called?  Using the #pragma exit way,
>I've been getting some lockup in my program... :(


The #pragma is inherently non-portable. The OS should free all of the
memory you malloc'd or new'd, although it is wise to be more careful
with memory management if the program is to have long termporal
existence.

// DQG.


--
+------------------------------------------------------------------------+
| Derick R. Qua-Gonzalez                                      | ________ |
| Department of High Energy Physics, Cal State University     | \      / |
| dqua@dqua.EarthLink.Net                                     |  \    /  |
|     ``It is better to be hated for what one is,             |   \  /   |
|       than loved for what one is not.'' (A. Gide)           | G  \/ USA|
+-------------------------------------------------------------+----------+
Technical Details
Message-ID: <dqua.810459138@dqua>
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
References: <42hdl3$rkr@ratty.wolfe.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
From: dqua@earthlink.net (Derick J.R. Qua-Gonzalez)
Newsgroups: comp.os.msdos.programmer,comp.lang.c
Subject: Re: Freeing memory in #pragma exit
Date: 7 Sep 95 07:32:18 GMT
Organization: Earthlink Network, Inc.
Message-ID: <dqua.810459138@dqua>
References: <42hdl3$rkr@ratty.wolfe.net>
NNTP-Posting-Host: dqua.earthlink.net