linked list cleanups

added list methods invoke(), destroy_offset(), destroy_function()
simplified list destruction when destroying its items
This commit is contained in:
Martin Willi
2006-10-24 08:46:17 +00:00
parent 5c4cc9a4e3
commit 55bbff11ec
26 changed files with 312 additions and 551 deletions
+1 -8
View File
@@ -333,14 +333,7 @@ static void destroy(private_connection_t *this)
{
if (ref_put(&this->refcount))
{
proposal_t *proposal;
while (this->proposals->remove_last(this->proposals, (void**)&proposal) == SUCCESS)
{
proposal->destroy(proposal);
}
this->proposals->destroy(this->proposals);
this->proposals->destroy_offset(this->proposals, offsetof(proposal_t, destroy));
this->my_host->destroy(this->my_host);
this->other_host->destroy(this->other_host);
free(this->name);