diff options
Diffstat (limited to 'content/content.c')
-rw-r--r-- | content/content.c | 33 |
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. |