Fix some potential issues with lists not being freed properly

svn path=/trunk/netsurf/; revision=9677
This commit is contained in:
Chris Young 2009-11-15 23:11:41 +00:00
parent 9e86512c4f
commit bc4abe9087
3 changed files with 11 additions and 9 deletions

View File

@ -224,17 +224,19 @@ void ami_free_download_list(struct List *dllist)
struct dlnode *node;
struct dlnode *nnode;
if(!dllist) return;
if(IsListEmpty(dllist)) return;
node = (struct dlnode *)GetHead((struct List *)dllist);
while(nnode=(struct dlnode *)GetSucc((struct Node *)node))
do
{
nnode=(struct dlnode *)GetSucc((struct Node *)node);
free(node->node.ln_Name);
free(node->filename);
Remove((struct Node *)node);
FreeVec((struct Node *)node);
node=nnode;
}
}while(node=nnode);
}
void gui_window_save_as_link(struct gui_window *g, struct content *c)

View File

@ -1812,7 +1812,6 @@ void ami_quit_netsurf(void)
ami_close_all_tabs(gwin);
break;
}
node = nnode;
} while(node = nnode);
}

View File

@ -61,17 +61,18 @@ void FreeObjList(struct MinList *objlist)
struct nsObject *node;
struct nsObject *nnode;
if(IsMinListEmpty(objlist)) return;
node = (struct nsObject *)GetHead((struct List *)objlist);
while(nnode=(struct nsObject *)GetSucc((struct Node *)node))
do
{
nnode=(struct nsObject *)GetSucc((struct Node *)node);
if(node->Type == AMINS_CALLBACK)
ami_remove_timer_event((struct nscallback *)node->objstruct);
DelObject(node);
node=nnode;
}
}while(node=nnode);
FreeVec(objlist);
}