summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-07-30 16:16:07 +0000
committerJames Bursa <james@netsurf-browser.org>2004-07-30 16:16:07 +0000
commit54d25de3719137a71af3415d952f1f8eb1296d4c (patch)
tree863d233e7c052282299aa09b65268086a6a0d1aa /content/content.c
parentf0c6cb6d1a1352876dec6cecb4fb2faef1eed68e (diff)
downloadnetsurf-54d25de3719137a71af3415d952f1f8eb1296d4c.tar.gz
netsurf-54d25de3719137a71af3415d952f1f8eb1296d4c.tar.bz2
[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
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/content/content.c b/content/content.c
index a30c72f2b..433169d6a 100644
--- a/content/content.c
+++ b/content/content.c
@@ -539,7 +539,7 @@ void content_clean(void)
content_stop_check(c);
}
- /* attempt to shrike the memory cache (unused fresh contents) */
+ /* attempt to shrink the memory cache (unused fresh contents) */
size = 0;
next = 0;
for (c = content_list; c; c = c->next) {
@@ -614,6 +614,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.
*
* Calls the redraw function for the content, if it exists.