mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-27 03:44:23 +03:00
Fix bug #3159040: make destruction order of browser_window objects sane
svn path=/trunk/netsurf/; revision=11345
This commit is contained in:
parent
fbbfb2a75f
commit
1034f16f0b
@ -989,6 +989,20 @@ void browser_window_destroy_internal(struct browser_window *bw)
|
||||
if (bw->children != NULL || bw->iframes != NULL)
|
||||
browser_window_destroy_children(bw);
|
||||
|
||||
schedule_remove(browser_window_refresh, bw);
|
||||
|
||||
/* Destruction order is important: we must ensure that the frontend
|
||||
* destroys any window(s) associated with this browser window before
|
||||
* we attempt any destructive cleanup.
|
||||
*
|
||||
* Additionally, we must destroy any selection and history before
|
||||
* releasing the handle to any content objects this window is using.
|
||||
*/
|
||||
|
||||
gui_window_destroy(bw->window);
|
||||
selection_destroy(bw->sel);
|
||||
history_destroy(bw->history);
|
||||
|
||||
if (bw->loading_content != NULL) {
|
||||
hlcache_handle_release(bw->loading_content);
|
||||
bw->loading_content = NULL;
|
||||
@ -1004,12 +1018,6 @@ void browser_window_destroy_internal(struct browser_window *bw)
|
||||
bw->current_content = NULL;
|
||||
}
|
||||
|
||||
schedule_remove(browser_window_refresh, bw);
|
||||
|
||||
selection_destroy(bw->sel);
|
||||
history_destroy(bw->history);
|
||||
gui_window_destroy(bw->window);
|
||||
|
||||
free(bw->name);
|
||||
free(bw->frag_id);
|
||||
free(bw->status_text);
|
||||
|
Loading…
x
Reference in New Issue
Block a user