summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-05-16 21:16:44 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-05-16 21:16:44 +0000
commitb92ca9cd30ef1aefcd15898110fcd2d9c84daf63 (patch)
tree60099a44b4178460a944dc2cc6824bf59a94e969
parent955896ac4676f5341daf4a6974a737eae2888d7a (diff)
downloadnetsurf-b92ca9cd30ef1aefcd15898110fcd2d9c84daf63.tar.gz
netsurf-b92ca9cd30ef1aefcd15898110fcd2d9c84daf63.tar.bz2
Clean up after content factory
svn path=/trunk/netsurf/; revision=12415
-rw-r--r--content/content_factory.c18
-rw-r--r--content/content_factory.h2
-rw-r--r--desktop/netsurf.c3
3 files changed, 23 insertions, 0 deletions
diff --git a/content/content_factory.c b/content/content_factory.c
index 95e7679ad..ae226a4d1 100644
--- a/content/content_factory.c
+++ b/content/content_factory.c
@@ -45,6 +45,24 @@ typedef struct content_handler_entry {
static content_handler_entry *content_handlers;
/**
+ * Clean up after the content factory
+ */
+void content_factory_fini(void)
+{
+ content_handler_entry *victim;
+
+ while (content_handlers != NULL) {
+ victim = content_handlers;
+
+ content_handlers = content_handlers->next;
+
+ lwc_string_unref(victim->mime_type);
+
+ free(victim);
+ }
+}
+
+/**
* Register a handler with the content factory
*
* \param mime_type MIME type to handle
diff --git a/content/content_factory.h b/content/content_factory.h
index 330ce6812..aff7a64ac 100644
--- a/content/content_factory.h
+++ b/content/content_factory.h
@@ -31,6 +31,8 @@ struct llcache_handle;
typedef struct content_handler content_handler;
+void content_factory_fini(void);
+
nserror content_factory_register_handler(lwc_string *mime_type,
const content_handler *handler);
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 9861e7e4a..fe93818ea 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -32,6 +32,7 @@
#include "utils/config.h"
#include "utils/utsname.h"
+#include "content/content_factory.h"
#include "content/fetch.h"
#include "content/hlcache.h"
#include "content/urldb.h"
@@ -214,6 +215,8 @@ void netsurf_exit(void)
html_fini();
css_fini();
+ content_factory_fini();
+
LOG(("Closing utf8"));
utf8_finalise();