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
commit5656457c77e63713e8b202adfee0e1e98e9055c6 (patch)
treed1cb285f901829e2a6258384a36e5551781b6aac /stoc
parent2a43e5baca070819bb24e54590947ea74635313c (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 e4f6e6855..3cf8f0899 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