diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-07-02 10:43:51 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-07-02 10:43:51 +0000 |
commit | 8bc570246b100d472ead0fb8813ea4ffeac9e68c (patch) | |
tree | 17afcc17589dcc4a7ef63a1a2e8f55535fbd5872 /cppu | |
parent | 1c21bb466c0101dfcbfe59aa8cd273fe46ad531b (diff) |
#67468# added unloading for bridges/ environments
Diffstat (limited to 'cppu')
-rw-r--r-- | cppu/source/threadpool/current.cxx | 5 | ||||
-rw-r--r-- | cppu/source/uno/lbenv.cxx | 24 | ||||
-rw-r--r-- | cppu/source/uno/lbmap.cxx | 10 |
3 files changed, 22 insertions, 17 deletions
diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index 01f19995d550..ae81ef703d34 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.cxx @@ -2,9 +2,9 @@ * * $RCSfile: current.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dbo $ $Date: 2001-05-07 15:07:00 $ + * last change: $Author: dbo $ $Date: 2001-07-02 11:43:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -334,6 +334,7 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( if (pCurrentEnv) { Mapping aMapping( pCurrentEnv, pTargetEnv ); + (*pCurrentEnv->release)( pCurrentEnv ); if (aMapping.is()) { aMapping.mapInterface( diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 15029c758877..8c4d3013248d 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: lbenv.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dbo $ $Date: 2001-04-27 08:24:08 $ + * last change: $Author: dbo $ $Date: 2001-07-02 11:43:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #ifndef _RTL_PROCESS_H_ #include <rtl/process.h> #endif +#ifndef _RTL_UNLOAD_H_ +#include <rtl/unload.h> +#endif #ifndef _RTL_STRING_HXX_ #include <rtl/string.hxx> #endif @@ -229,14 +232,13 @@ struct uno_DefaultEnvironment : public uno_ExtEnvironment { sal_Int32 nRef; sal_Int32 nWeakRef; - oslModule hModule; Mutex aAccess; Ptr2ObjectMap aPtr2ObjectMap; OId2ObjectMap aOId2ObjectMap; uno_DefaultEnvironment( - const OUString & rTypeName_, void * pContext_, oslModule hMod_ ) + const OUString & rTypeName_, void * pContext_ ) SAL_THROW( () ); ~uno_DefaultEnvironment() SAL_THROW( () ); @@ -532,11 +534,6 @@ static void SAL_CALL defenv_release( uno_Environment * pEnv ) { (*pEnv->environmentDisposing)( pEnv ); } - // unload init module - if (that->hModule) - { - ::osl_unloadModule( that->hModule ); - } OSL_ENSURE( that->aOId2ObjectMap.empty(), "### object entries left!" ); } @@ -594,11 +591,10 @@ static void SAL_CALL defenv_dispose( uno_Environment * pEnv ) //__________________________________________________________________________________________________ uno_DefaultEnvironment::uno_DefaultEnvironment( - const OUString & rTypeName_, void * pContext_, oslModule hMod_ ) + const OUString & rTypeName_, void * pContext_ ) SAL_THROW( () ) : nRef( 0 ) , nWeakRef( 0 ) - , hModule( hMod_ ) { uno_Environment * that = (uno_Environment *)this; that->pReserved = 0; @@ -1012,7 +1008,7 @@ static uno_Environment * initDefaultEnvironment( // create default environment if (rEnvTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(UNO_LB_UNO) )) { - uno_DefaultEnvironment * that = new uno_DefaultEnvironment( rEnvTypeName, pContext, 0 ); + uno_DefaultEnvironment * that = new uno_DefaultEnvironment( rEnvTypeName, pContext ); pEnv = (uno_Environment *)that; (*pEnv->acquire)( pEnv ); that->computeObjectIdentifier = unoenv_computeObjectIdentifier; @@ -1045,9 +1041,11 @@ static uno_Environment * initDefaultEnvironment( (uno_initEnvironmentFunc)::osl_getSymbol( hMod, aSymbolName.pData ); if (fpInit) { - pEnv = (uno_Environment *)new uno_DefaultEnvironment( rEnvTypeName, pContext, hMod ); + pEnv = (uno_Environment *)new uno_DefaultEnvironment( + rEnvTypeName, pContext ); (*pEnv->acquire)( pEnv ); (*fpInit)( pEnv ); // init of environment + ::rtl_registerModuleForUnloading( hMod ); } else { diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index c88c6c0da1a7..bf22ce1294f3 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: lbmap.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: dbo $ $Date: 2001-04-12 13:39:23 $ + * last change: $Author: dbo $ $Date: 2001-07-02 11:43:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,6 +65,9 @@ #define CPPU_TRACE #endif +#ifndef _RTL_UNLOAD_H_ +#include <rtl/unload.h> +#endif #ifndef _RTL_USTRING_HXX_ #include <rtl/ustring.hxx> #endif @@ -412,7 +415,10 @@ static Mapping loadExternalMapping( (*fpGetMapFunc)( (uno_Mapping **)&aExt, rFrom.get(), rTo.get() ); OSL_ASSERT( aExt.is() ); if (aExt.is()) + { + ::rtl_registerModuleForUnloading( hModule ); return aExt; + } } ::osl_unloadModule( hModule ); setNegativeBridge( aName ); |