diff options
author | randomdan <randomdan@localhost> | 2011-09-17 14:04:06 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-09-17 14:04:06 +0000 |
commit | e00af0620a1c2399840cc00eca5ddcffb4381208 (patch) | |
tree | f8f5a891e63273b8caec7d44168ae0c5e4f9f0ff | |
parent | Remove pointless check (diff) | |
download | project2-e00af0620a1c2399840cc00eca5ddcffb4381208.tar.bz2 project2-e00af0620a1c2399840cc00eca5ddcffb4381208.tar.xz project2-e00af0620a1c2399840cc00eca5ddcffb4381208.zip |
Empty the XSL row cache on iteration
-rw-r--r-- | project2/xml/xslRowsCache.cpp | 11 | ||||
-rw-r--r-- | project2/xml/xslRowsCache.h | 1 |
2 files changed, 12 insertions, 0 deletions
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 <pch.hpp> +#include <xmlObjectLoader.h> #include "xslRowsCache.h" #include <string.h> #include <libxml/HTMLparser.h> @@ -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 |