mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Fix some potential issues with lists not being freed properly
svn path=/trunk/netsurf/; revision=9677
This commit is contained in:
parent
9e86512c4f
commit
bc4abe9087
@ -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)
|
||||
|
@ -1812,7 +1812,6 @@ void ami_quit_netsurf(void)
|
||||
ami_close_all_tabs(gwin);
|
||||
break;
|
||||
}
|
||||
node = nnode;
|
||||
|
||||
} while(node = nnode);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user