summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2011-01-07 14:53:16 +0100
committersb <sb@openoffice.org>2011-01-07 14:53:16 +0100
commit8e4ab13027f6ee90c788c064ff0912347cafb652 (patch)
tree66e1aa68a8a63c07e3baaf6c9006b5fbbcf9a9e6 /stoc
parent1b327acf918b99289b8533863df51d64c159e25c (diff)
sb139: #i113686# let LRU_Cache::setValue nop after LRU_Cache::clear (so that IdlReflectionServiceImpl does not leak ring-referenced _aElements members after dispose)
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/corereflection/lrucache.hxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx
index 062c13d981e5..98c5faf4586d 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -177,9 +177,9 @@ template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual >
inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::setValue(
const t_Key & rKey, const t_Val & rValue )
{
+ ::osl::MutexGuard aGuard( _aCacheMutex );
if (_nCachedElements > 0)
{
- ::osl::MutexGuard aGuard( _aCacheMutex );
const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) );
CacheEntry * pEntry;
@@ -221,6 +221,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::clear()
_pBlock[nPos].aKey = t_Key();
_pBlock[nPos].aVal = t_Val();
}
+ _nCachedElements = 0;
#ifdef __CACHE_DIAGNOSE
OSL_TRACE( "> cleared cache <\n" );
#endif