summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/content_factory.c3
-rw-r--r--content/content_factory.h13
-rw-r--r--content/content_protected.h2
3 files changed, 7 insertions, 11 deletions
diff --git a/content/content_factory.c b/content/content_factory.c
index 3f06dc432..8da73337c 100644
--- a/content/content_factory.c
+++ b/content/content_factory.c
@@ -56,6 +56,9 @@ void content_factory_fini(void)
content_handlers = content_handlers->next;
+ if (victim->handler->fini != NULL)
+ victim->handler->fini();
+
lwc_string_unref(victim->mime_type);
free(victim);
diff --git a/content/content_factory.h b/content/content_factory.h
index 26c587575..22205dc02 100644
--- a/content/content_factory.h
+++ b/content/content_factory.h
@@ -31,26 +31,17 @@
nserror HNAME##_init(void) \
{ \
uint32_t i; \
- nserror error; \
+ nserror error = NSERROR_OK; \
\
for (i = 0; i < NOF_ELEMENTS(HTYPELIST); i++) { \
error = content_factory_register_handler( \
HTYPELIST[i], \
&HHANDLER); \
if (error != NSERROR_OK) \
- goto error; \
+ break; \
} \
\
- return NSERROR_OK; \
- \
-error: \
- HNAME##_fini(); \
- \
return error; \
-} \
-/* Pointless */ \
-void HNAME##_fini(void) \
-{ \
}
struct content;
diff --git a/content/content_protected.h b/content/content_protected.h
index d9a021f3e..633f33241 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -40,6 +40,8 @@ struct rect;
struct redraw_context;
struct content_handler {
+ void (*fini)(void);
+
nserror (*create)(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
llcache_handle *llcache,