summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/xml/xslRowsCache.cpp11
-rw-r--r--project2/xml/xslRowsCache.h1
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