diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h index 83cda8689..da85a9aeb 100644 --- a/include/utils/GenerationCache.h +++ b/include/utils/GenerationCache.h @@ -88,11 +88,13 @@ private: void attachToCache(const sp >& entry); void detachFromCache(const sp >& entry); + + const V mNullValue; }; // class GenerationCache template GenerationCache::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mListener(NULL) { + mListener(NULL), mNullValue(NULL) { }; template @@ -154,7 +156,7 @@ const V& GenerationCache::get(const K& key) { return entry->value; } - return NULL; + return mNullValue; } template