diff options
author | Joachim Lingner <jl@openoffice.org> | 2001-07-31 13:52:57 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2001-07-31 13:52:57 +0000 |
commit | a2ffcd0da3b77739cbb8f5689a0c08e4287984c8 (patch) | |
tree | 0848d6e74ce01a1dd174e8cf173505f08e681804 /stoc | |
parent | c09d887edea8ce6379931bce349d4a96eff98d6b (diff) |
#90043# Destruction of typedescription manager lead caused memory corruption
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/tdmanager/tdmgr.cxx | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/stoc/source/tdmanager/tdmgr.cxx b/stoc/source/tdmanager/tdmgr.cxx index c6f96265e..baaa42a52 100644 --- a/stoc/source/tdmanager/tdmgr.cxx +++ b/stoc/source/tdmanager/tdmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tdmgr.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: jbu $ $Date: 2001-06-22 16:21:01 $ + * last change: $Author: jl $ $Date: 2001-07-31 14:52:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -493,25 +493,29 @@ void SAL_CALL ManagerImpl::insert( const Any & rElement ) void SAL_CALL ManagerImpl::remove( const Any & rElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException) { - Reference< XHierarchicalNameAccess > xElem; - if (! (rElement >>= xElem)) - { - throw IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("no type description provider given!") ), - (XWeak *)(OWeakObject *)this, 0 ); - } - - MutexGuard aGuard( _aComponentMutex ); - ProviderVector::iterator iFind( find( _aProviders.begin(), _aProviders.end(), xElem ) ); - if (iFind == _aProviders.end()) + if (!rBHelper.bDisposed && !rBHelper.bInDispose) { - throw NoSuchElementException( - OUString( RTL_CONSTASCII_USTRINGPARAM("provider not found!") ), - (XWeak *)(OWeakObject *)this ); + Reference< XHierarchicalNameAccess > xElem; + if (! (rElement >>= xElem)) + { + throw IllegalArgumentException( + OUString( RTL_CONSTASCII_USTRINGPARAM("no type description provider given!") ), + (XWeak *)(OWeakObject *)this, 0 ); + } + + MutexGuard aGuard( _aComponentMutex ); + ProviderVector::iterator iFind( find( _aProviders.begin(), _aProviders.end(), xElem ) ); + if (iFind == _aProviders.end()) + { + throw NoSuchElementException( + OUString( RTL_CONSTASCII_USTRINGPARAM("provider not found!") ), + (XWeak *)(OWeakObject *)this ); + } + _aProviders.erase( iFind ); } - _aProviders.erase( iFind ); - Reference< XComponent > xComp( xElem, UNO_QUERY ); - if (xComp.is()) + + Reference< XComponent > xComp; + if (rElement >>= xComp) xComp->removeEventListener( &_aEventListener ); } |