Commit d94741fc authored by KIM JungYong's avatar KIM JungYong Committed by Uze Choi

Fix stopCaching logic in the RE client.

When caught exception at calling stopCaching(),
can not start caching again, reason that IsCaching boolean does not changed in RE client.

In this patch,
exception handling and disable IsCaching flag.

Change-Id: I80f4629d21ea16799f945c90d56f70f81bc38e90
Signed-off-by: default avatarKIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18125Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarUze Choi <uzchoi@samsung.com>
parent 4248e10c
......@@ -128,7 +128,16 @@ namespace OIC
if (observeIns != observeCacheIDmap.end())
{
(observeIns->second)->stopCache();
try
{
(observeIns->second)->stopCache();
}
catch (...)
{
(observeIns->second).reset();
observeCacheIDmap.erase(observeIns);
throw;
}
(observeIns->second).reset();
observeCacheIDmap.erase(observeIns);
return;
......
......@@ -332,7 +332,19 @@ namespace OIC
return;
}
ResourceCacheManager::getInstance()->cancelResourceCache(m_cacheId);
try
{
ResourceCacheManager::getInstance()->cancelResourceCache(m_cacheId);
}
catch (const RCSInvalidParameterException &)
{
throw;
}
catch (...)
{
m_cacheId = 0;
throw;
}
m_cacheId = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment