From 339bed72725fe901724440939558c5f9817107ed Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 15 Sep 2011 22:47:50 +0000 Subject: Virtualise content handler finalisation calls. Remove pointless implementations. svn path=/trunk/netsurf/; revision=12797 --- content/content_factory.c | 3 +++ content/content_factory.h | 13 ++----------- content/content_protected.h | 2 ++ 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'content') 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, -- cgit v1.2.3