diff options
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/inc/componentmodule.cxx | 11 | ||||
-rw-r--r-- | extensions/source/resource/oooresourceloader.cxx | 9 |
2 files changed, 8 insertions, 12 deletions
diff --git a/extensions/source/inc/componentmodule.cxx b/extensions/source/inc/componentmodule.cxx index 17f820e1f6f5..3f1f4925ea9d 100644 --- a/extensions/source/inc/componentmodule.cxx +++ b/extensions/source/inc/componentmodule.cxx @@ -42,9 +42,9 @@ namespace COMPMOD_NAMESPACE // implementation for <type>OModule</type>. not threadsafe, has to be guarded by its owner class OModuleImpl { - ResMgr* m_pResources; - bool m_bInitialized; - OString m_sFilePrefix; + std::unique_ptr<ResMgr> m_pResources; + bool m_bInitialized; + OString m_sFilePrefix; public: /// ctor @@ -66,7 +66,6 @@ namespace COMPMOD_NAMESPACE OModuleImpl::~OModuleImpl() { - delete m_pResources; } @@ -77,7 +76,7 @@ namespace COMPMOD_NAMESPACE { DBG_ASSERT(!m_sFilePrefix.isEmpty(), "OModuleImpl::getResManager: no resource file prefix!"); // create a manager with a fixed prefix - m_pResources = ResMgr::CreateResMgr(m_sFilePrefix.getStr()); + m_pResources.reset( ResMgr::CreateResMgr(m_sFilePrefix.getStr()) ); DBG_ASSERT(m_pResources, OStringBuffer("OModuleImpl::getResManager: could not create the resource manager (file name: ") .append(m_sFilePrefix) @@ -85,7 +84,7 @@ namespace COMPMOD_NAMESPACE m_bInitialized = true; } - return m_pResources; + return m_pResources.get(); } diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx index 0961cc0b34e6..f50d22ebd624 100644 --- a/extensions/source/resource/oooresourceloader.cxx +++ b/extensions/source/resource/oooresourceloader.cxx @@ -84,7 +84,7 @@ namespace extensions { namespace resource ::osl::Mutex m_aMutex; Reference< XResourceBundle > m_xParent; Locale m_aLocale; - SimpleResMgr* m_pResourceManager; + std::unique_ptr<SimpleResMgr> m_pResourceManager; ResourceTypes m_aResourceTypes; public: @@ -177,13 +177,11 @@ namespace extensions { namespace resource :m_aLocale( _rLocale ) ,m_pResourceManager( nullptr ) { - m_pResourceManager = new SimpleResMgr( OUStringToOString( _rBaseName, RTL_TEXTENCODING_UTF8 ).getStr(), - LanguageTag( m_aLocale) ); + m_pResourceManager.reset( new SimpleResMgr( OUStringToOString( _rBaseName, RTL_TEXTENCODING_UTF8 ).getStr(), + LanguageTag( m_aLocale) ) ); if ( !m_pResourceManager->IsValid() ) { - delete m_pResourceManager; - m_pResourceManager = nullptr; throw MissingResourceException(); } @@ -194,7 +192,6 @@ namespace extensions { namespace resource OpenOfficeResourceBundle::~OpenOfficeResourceBundle() { - delete m_pResourceManager; } Reference< XResourceBundle > SAL_CALL OpenOfficeResourceBundle::getParent() throw (RuntimeException, std::exception) |