From 8e4ab13027f6ee90c788c064ff0912347cafb652 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 7 Jan 2011 14:53:16 +0100 Subject: sb139: #i113686# let LRU_Cache::setValue nop after LRU_Cache::clear (so that IdlReflectionServiceImpl does not leak ring-referenced _aElements members after dispose) --- stoc/source/corereflection/lrucache.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stoc') 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 -- cgit v1.2.3 From 0c949676d836385e1925d2ae6b50d597266fa38e Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 7 Jan 2011 15:14:58 +0100 Subject: sb139: #i113686# do not clear IdlReflectionServiceImpl::_x[TD]Mgr to avoid null pointer dereferentiation --- stoc/source/corereflection/crefl.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'stoc') diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 99019e959dfa..d3ebed762bac 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -179,8 +179,6 @@ void IdlReflectionServiceImpl::dispose() MutexGuard aGuard( _aComponentMutex ); _aElements.clear(); - _xTDMgr.clear(); - _xMgr.clear(); #ifdef TEST_LIST_CLASSES OSL_ENSURE( g_aClassNames.size() == 0, "### idl classes still alive!" ); ClassNameList::const_iterator iPos( g_aClassNames.begin() ); -- cgit v1.2.3 From cdd45d555cc6afca1aa2bf3a43922256c478d54b Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 10 Jan 2011 15:01:04 +0100 Subject: sb139: #i112929# removed unused s_semi (patch by cmc) --- stoc/source/security/file_policy.cxx | 1 - 1 file changed, 1 deletion(-) (limited to 'stoc') diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index e9eb46ac6344..b59502852d1d 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -444,7 +444,6 @@ static OUString s_user = OUSTR("user"); static OUString s_permission = OUSTR("permission"); static OUString s_openBrace = OUSTR("{"); static OUString s_closingBrace = OUSTR("}"); -static OUString s_semi = OUSTR(";"); static OUString s_filePermission = OUSTR("com.sun.star.io.FilePermission"); static OUString s_socketPermission = OUSTR("com.sun.star.connection.SocketPermission"); -- cgit v1.2.3