comp.lang.ada
 help / color / mirror / Atom feed
From: Larry Hazel <lhhazel@otelco.net>
Subject: Re: unchecked_deallocation
Date: Wed, 17 Jul 2002 13:29:38 -0500
Date: 2002-07-17T13:29:38-05:00	[thread overview]
Message-ID: <3D35B792.9020407@otelco.net> (raw)
In-Reply-To: 7e428372.0207171007.6df0fdae@posting.google.com

Felix Engemann wrote:
> Hi all,
> 
> I'm just writing a generic double linked list package.
> I want to implement a function destroy_list, wich should return null
> and free the space. My question is:
> 
> is all the space freed, if i set a pointer to the first node and then free the
> space with free(pointer_to_first_node)
> 
> or do i have to delete and free from node to node, in order to free all the
> space ?
> 
> Thanx Felix

You must deallocate every node individually.  Use a recursive procedure (not a 
function) to do this.  Returning a null pointer serves no purpose.

Larry




  reply	other threads:[~2002-07-17 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-17 18:07 unchecked_deallocation Felix Engemann
2002-07-17 18:29 ` Larry Hazel [this message]
2002-07-17 21:44 ` unchecked_deallocation Jan Prazak
2002-07-18  8:13   ` unchecked_deallocation Felix Engemann
  -- strict thread matches above, loose matches on Subject: below --
1998-12-01  0:00 Unchecked_Deallocation robinsoj
1998-12-02  0:00 ` Unchecked_Deallocation Tom Moran
1998-12-03  0:00 ` Unchecked_Deallocation Fanni Kolchina
1997-10-22  0:00 Unchecked_Deallocation Scott Barrish
1997-10-22  0:00 ` Unchecked_Deallocation Anonymous
1997-10-22  0:00 ` Unchecked_Deallocation bklungle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox