{
state = CACHE_STATE::DESTROYED;
- if(mode == CACHE_MODE::OBSERVE)
- {
- sResource->cancelObserve();
- }
if (subscriberList != nullptr)
{
subscriberList->clear();
subscriberList.release();
}
+
+ if(mode == CACHE_MODE::OBSERVE)
+ {
+ try
+ {
+ sResource->cancelObserve();
+ } catch (...)
+ {
+ // ignore the exception because data cache was released.
+ }
+ }
}
void DataCache::initializeDataCache(PrimitiveResourcePtr pResource)
if (foundCacheHandler->isEmptySubscriber())
{
s_cacheDataList->remove(foundCacheHandler);
-// foundCacheHandler.reset();
}
}
}
{
if (updateId == 0)
{
- throw InvalidParameterException {"[getCachedData] CacheID is invaild"};
+ throw InvalidParameterException {"[getCachedData] CacheID is NULL"};
}
DataCachePtr foundCache = findDataCache(updateId);
{
if (pResource == nullptr)
{
- throw InvalidParameterException {"[getCachedData] Primitive Resource is invaild"};
+ throw InvalidParameterException {"[getCachedData] Primitive Resource is nullptr"};
}
DataCachePtr handler = findDataCache(pResource);
{
if (id == 0)
{
- throw InvalidParameterException {"[getCachedData] CacheID is invaild"};
+ throw InvalidParameterException {"[getCachedData] CacheID is NULL"};
}
DataCachePtr handler = findDataCache(id);
{
if (pResource == nullptr)
{
- throw InvalidParameterException {"[getResourceCacheState] Primitive Resource is invaild"};
+ throw InvalidParameterException {"[getResourceCacheState] Primitive Resource is nullptr"};
}
DataCachePtr handler = findDataCache(pResource);
{
if (id == 0)
{
- throw InvalidParameterException {"[getResourceCacheState] CacheID is invaild"};
+ throw InvalidParameterException {"[getResourceCacheState] CacheID is NULL"};
}
DataCachePtr handler = findDataCache(id);