From 0557f9a331db3dbbdabf5bc6d7a5fcac81a09897 Mon Sep 17 00:00:00 2001 From: randomdan Date: Sat, 17 Sep 2011 14:04:06 +0000 Subject: Empty the XSL row cache on iteration --- project2/xml/xslRowsCache.cpp | 11 +++++++++++ project2/xml/xslRowsCache.h | 1 + 2 files changed, 12 insertions(+) diff --git a/project2/xml/xslRowsCache.cpp b/project2/xml/xslRowsCache.cpp index f229dda..0bfb4a5 100644 --- a/project2/xml/xslRowsCache.cpp +++ b/project2/xml/xslRowsCache.cpp @@ -1,4 +1,5 @@ #include +#include #include "xslRowsCache.h" #include #include @@ -77,3 +78,13 @@ XslRowsCache::queue(const Glib::ustring & url, const char * encoding) const } } +class XslCacheClearer : public ComponentLoader { + public: + void onIteration() + { + Logger()->messagef(LOG_DEBUG, "%s: Clearing XSL row document cache", __PRETTY_FUNCTION__); + XslRowsCache::documents.clear(); + } +}; +DECLARE_CUSTOM_COMPONENT_LOADER("XslCacheClearer", XslCacheClearer, XslCacheClearer, ComponentLoader); + diff --git a/project2/xml/xslRowsCache.h b/project2/xml/xslRowsCache.h index 8fb9940..ec3b6e8 100644 --- a/project2/xml/xslRowsCache.h +++ b/project2/xml/xslRowsCache.h @@ -29,6 +29,7 @@ class XslRowsCache { static CurlBulkFetcher cbf; friend class XslCachePopulator; + friend class XslCacheClearer; }; #endif -- cgit v1.2.3