diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | bitmap.c | 1 | ||||
-rw-r--r-- | cache.h | 3 |
3 files changed, 4 insertions, 1 deletions
@@ -7,6 +7,7 @@ VDR Plugin 'text2skin' Revision History - Documentation spelling fixes. - Added experimental RELAX NG schema for skin XML files. - Set minimum value of bitmap cache size in menu to 1. +- Fix bitmap cache size initialization when built with gcc 4.6. 2010-06-21: Version 1.3.1 @@ -90,6 +90,7 @@ void cText2SkinBitmap::Init(void) { #ifdef HAVE_IMAGEMAGICK InitializeMagick(NULL); #endif + mCache.SetMaxItems(Text2SkinSetup.MaxCacheFill); } cText2SkinBitmap::cText2SkinBitmap(void) { @@ -31,6 +31,7 @@ public: bool Contains(const key_type &Key); data_type &operator[](const key_type &Key); uint Count(void) { return mUsage.size(); } + void SetMaxItems(uint MaxItems) { mMaxItems = MaxItems; } }; template<class key_type, class data_type> @@ -85,7 +86,7 @@ data_type &cxCache<key_type, data_type>::operator[](const key_type &Key) return it->second; } - if (mUsage.size() == mMaxItems) { + while (mUsage.size() >= mMaxItems) { item_iterator it = mItems.find(*mUsage.begin()); DeleteObject(it->first, it->second); mUsage.erase(mUsage.begin()); |