mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-20 09:39:18 +03:00
[project @ 2004-07-30 16:16:07 by bursa]
Implement content_quit() and ro_gui_window_quit() to free resources on quit. svn path=/import/netsurf/; revision=1164
This commit is contained in:
parent
f0c6cb6d1a
commit
54d25de371
@ -539,7 +539,7 @@ void content_clean(void)
|
|||||||
content_stop_check(c);
|
content_stop_check(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* attempt to shrike the memory cache (unused fresh contents) */
|
/* attempt to shrink the memory cache (unused fresh contents) */
|
||||||
size = 0;
|
size = 0;
|
||||||
next = 0;
|
next = 0;
|
||||||
for (c = content_list; c; c = c->next) {
|
for (c = content_list; c; c = c->next) {
|
||||||
@ -613,6 +613,37 @@ void content_reset(struct content *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free all contents in the content_list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void content_quit(void)
|
||||||
|
{
|
||||||
|
bool progress = true;
|
||||||
|
struct content *c, *next;
|
||||||
|
|
||||||
|
while (content_list && progress) {
|
||||||
|
progress = false;
|
||||||
|
for (c = content_list; c; c = next) {
|
||||||
|
next = c->next;
|
||||||
|
|
||||||
|
if (c->user_list->next &&
|
||||||
|
c->status != CONTENT_STATUS_ERROR)
|
||||||
|
/* content has users */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* content can be destroyed */
|
||||||
|
content_destroy(c);
|
||||||
|
progress = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_list) {
|
||||||
|
LOG(("bug: some contents could not be destroyed"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display content on screen.
|
* Display content on screen.
|
||||||
*
|
*
|
||||||
|
@ -268,6 +268,7 @@ void content_convert(struct content *c, int width, int height);
|
|||||||
void content_reformat(struct content *c, int width, int height);
|
void content_reformat(struct content *c, int width, int height);
|
||||||
void content_clean(void);
|
void content_clean(void);
|
||||||
void content_reset(struct content *c);
|
void content_reset(struct content *c);
|
||||||
|
void content_quit(void);
|
||||||
void content_redraw(struct content *c, int x, int y,
|
void content_redraw(struct content *c, int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
|
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
|
||||||
|
@ -96,8 +96,9 @@ void netsurf_poll(void)
|
|||||||
|
|
||||||
void netsurf_exit(void)
|
void netsurf_exit(void)
|
||||||
{
|
{
|
||||||
fetch_quit();
|
|
||||||
gui_quit();
|
gui_quit();
|
||||||
|
content_quit();
|
||||||
|
fetch_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -441,10 +441,11 @@ void gui_init2(void)
|
|||||||
|
|
||||||
void gui_quit(void)
|
void gui_quit(void)
|
||||||
{
|
{
|
||||||
|
ro_gui_window_quit();
|
||||||
ro_gui_hotlist_save();
|
ro_gui_hotlist_save();
|
||||||
ro_gui_history_quit();
|
ro_gui_history_quit();
|
||||||
free(gui_sprites);
|
free(gui_sprites);
|
||||||
wimp_close_down(task_handle);
|
xwimp_close_down(task_handle);
|
||||||
xhourglass_off();
|
xhourglass_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +162,7 @@ bool ro_gui_401login_keypress(wimp_key *key);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* in window.c */
|
/* in window.c */
|
||||||
|
void ro_gui_window_quit(void);
|
||||||
void ro_gui_window_click(struct gui_window *g, wimp_pointer *mouse);
|
void ro_gui_window_click(struct gui_window *g, wimp_pointer *mouse);
|
||||||
void ro_gui_window_open(struct gui_window *g, wimp_open *open);
|
void ro_gui_window_open(struct gui_window *g, wimp_open *open);
|
||||||
void ro_gui_window_redraw(struct gui_window *g, wimp_draw *redraw);
|
void ro_gui_window_redraw(struct gui_window *g, wimp_draw *redraw);
|
||||||
|
@ -302,6 +302,17 @@ void gui_window_destroy(struct gui_window *g)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy all browser windows.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void ro_gui_window_quit(void)
|
||||||
|
{
|
||||||
|
while (window_list)
|
||||||
|
browser_window_destroy(window_list->bw);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the title of a browser window.
|
* Set the title of a browser window.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user