mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-11 13:29:21 +03:00
Empty the schedule list before freeing and closing resources
svn path=/trunk/netsurf/; revision=12034
This commit is contained in:
parent
d3b8961017
commit
6a7402b330
@ -2165,8 +2165,8 @@ void gui_quit(void)
|
||||
if(IKeymap) DropInterface((struct Interface *)IKeymap);
|
||||
if(KeymapBase) CloseLibrary(KeymapBase);
|
||||
|
||||
ami_schedule_close_timer();
|
||||
ami_schedule_free();
|
||||
ami_schedule_close_timer();
|
||||
|
||||
FreeObjList(window_list);
|
||||
}
|
||||
|
@ -117,6 +117,25 @@ void schedule_remove(void (*callback)(void *p), void *p)
|
||||
if(restoreheap) pblHeapConstruct(schedule_list);
|
||||
}
|
||||
|
||||
void schedule_remove_all(void)
|
||||
{
|
||||
PblIterator *iterator;
|
||||
struct nscallback *nscb;
|
||||
|
||||
if(pblHeapIsEmpty(schedule_list)) return;
|
||||
|
||||
iterator = pblHeapIterator(schedule_list);
|
||||
|
||||
while ((nscb = pblIteratorNext(iterator)) != -1)
|
||||
{
|
||||
ami_remove_timer_event(nscb);
|
||||
pblIteratorRemove(iterator);
|
||||
FreeVec(nscb);
|
||||
};
|
||||
|
||||
pblIteratorFree(iterator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process events up to current time.
|
||||
* This implementation only takes the top entry off the heap, it does not
|
||||
@ -186,7 +205,8 @@ BOOL ami_schedule_create(void)
|
||||
|
||||
void ami_schedule_free(void)
|
||||
{
|
||||
pblHeapFree(schedule_list);
|
||||
schedule_remove_all();
|
||||
pblHeapFree(schedule_list); // this should be empty at this point
|
||||
}
|
||||
|
||||
void ami_schedule_open_timer(void)
|
||||
|
Loading…
Reference in New Issue
Block a user