home *** CD-ROM | disk | FTP | other *** search
- Path: sdd.hp.com!inn
- From: Jeff Grimmett <jgrimm@sdd.hp.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: More linked list nonsense
- Date: 25 Jan 1996 16:12:02 GMT
- Organization: Hewlett-Packard Company
- Message-ID: <4e8a4i$rht@news.sdd.hp.com>
- References: <4e5nih$iib@news.sdd.hp.com> <4e5rp4$tub@rs18.hrz.th-darmstadt.de>
- NNTP-Posting-Host: hpsdv330.sdd.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- kraemer@clri6a.gsi.de (Michael Kraemer) wrote:
-
- >> It just occurred to me last night, as I pored over steaming code, that
- >> the function Remove() (used to remove nodes from linked lists) might
- >> POSSIBLY not be freeing the memory allocated to the node it is removing.
- >> Does anyone have some insight on this? It's difficult to deallocate a
- >> node once it's not part of the list, but it's pretty STUPID to free it
- >> BEFORE. :-)
-
- > struct Node *pln;
- >
- > Remove(pln); /* remove it from the list */
- > free(pln); /* remove it from memory */
-
- DOH! Connection made... it just occurs to me that the node still exists,
- just isn't part of the list anymore...
-
- (sigh. I have to quite coding at midnight)
-
-