summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-09-17 14:04:06 +0000
committerrandomdan <randomdan@localhost>2011-09-17 14:04:06 +0000
commit0557f9a331db3dbbdabf5bc6d7a5fcac81a09897 (patch)
treef8f5a891e63273b8caec7d44168ae0c5e4f9f0ff
parentRemove pointless check (diff)
downloadproject2-0557f9a331db3dbbdabf5bc6d7a5fcac81a09897.tar.bz2
project2-0557f9a331db3dbbdabf5bc6d7a5fcac81a09897.tar.xz
project2-0557f9a331db3dbbdabf5bc6d7a5fcac81a09897.zip
Empty the XSL row cache on iteration
-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