diff options
-rw-r--r-- | css/css.c | 12 | ||||
-rw-r--r-- | css/css.h | 1 | ||||
-rw-r--r-- | desktop/netsurf.c | 4 |
3 files changed, 15 insertions, 2 deletions
@@ -52,6 +52,16 @@ static css_error nscss_register_imports(struct content_css_data *c); static css_error nscss_register_import(struct content_css_data *c, const hlcache_handle *import); +static css_stylesheet *blank_import; + +/** + * Clean up after the CSS subsystem + */ +void css_cleanup(void) +{ + if (blank_import != NULL) + css_stylesheet_destroy(blank_import); +} /** * Initialise a CSS content @@ -570,8 +580,6 @@ css_error nscss_register_import(struct content_css_data *c, struct content *s = hlcache_handle_get_content(import); sheet = s->data.css.sheet; } else { - static css_stylesheet *blank_import; - /* Create a blank sheet if needed. */ if (blank_import == NULL) { css_stylesheet_params params; @@ -61,6 +61,7 @@ struct nscss_import { uint64_t media; /**< Media types that sheet applies to */ }; +void css_cleanup(void); bool nscss_create(struct content *c, const struct http_parameter *params); diff --git a/desktop/netsurf.c b/desktop/netsurf.c index d0b57b569..5258efe11 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -35,6 +35,7 @@ #include "content/fetch.h" #include "content/hlcache.h" #include "content/urldb.h" +#include "css/css.h" #include "desktop/netsurf.h" #include "desktop/401login.h" #include "desktop/browser.h" @@ -181,6 +182,9 @@ void netsurf_exit(void) LOG(("Closing GUI")); gui_quit(); + /* Clean up after CSS */ + css_cleanup(); + LOG(("Closing search and related resources")); search_web_cleanup(); |