[fbreader] Added ZLFile::flushCache

This commit is contained in:
Slava Monich 2015-09-13 13:17:52 +03:00
parent b6a5dd4576
commit 94af49b211
2 changed files with 11 additions and 0 deletions

View file

@ -55,6 +55,16 @@ void ZLFile::initCache() {
#endif #endif
} }
void ZLFile::flushCache() {
#if FBREADER_THREAD_LOCAL_ZLFILE_PLAIN_STREAM_CACHE
ZLFilePlainStreamCache *cache = (ZLFilePlainStreamCache*)pthread_getspecific(plainStreamCacheKey);
if (cache) {
delete cache;
pthread_setspecific(plainStreamCacheKey, NULL);
}
#endif
}
ZLFile::ZLFile() : myMimeTypeIsUpToDate(true), myInfoIsFilled(true) { ZLFile::ZLFile() : myMimeTypeIsUpToDate(true), myInfoIsFilled(true) {
} }

View file

@ -38,6 +38,7 @@ public:
public: public:
static void initCache(); static void initCache();
static void flushCache();
static std::string fileNameToUtf8(const std::string &fileName); static std::string fileNameToUtf8(const std::string &fileName);
static std::string replaceIllegalCharacters(const std::string &fileName, char replaceWith); static std::string replaceIllegalCharacters(const std::string &fileName, char replaceWith);