summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx6
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.hxx5
2 files changed, 5 insertions, 6 deletions
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 48295a494841..63d88868add6 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -89,8 +89,6 @@ OfficeInstallationDirectories::OfficeInstallationDirectories(
// virtual
OfficeInstallationDirectories::~OfficeInstallationDirectories()
{
- delete m_pOfficeBrandDir;
- delete m_pUserDir;
}
@@ -216,8 +214,8 @@ void OfficeInstallationDirectories::initDirs()
osl::MutexGuard aGuard( m_aMutex );
if ( m_pOfficeBrandDir == nullptr )
{
- m_pOfficeBrandDir = new OUString;
- m_pUserDir = new OUString;
+ m_pOfficeBrandDir.reset( new OUString );
+ m_pUserDir.reset( new OUString );
uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(m_xCtx);
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
index b1b235622a73..4437951b7dec 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#include <memory>
namespace comphelper {
@@ -71,8 +72,8 @@ private:
OUString m_aOfficeBrandDirMacro;
OUString m_aUserDirMacro;
css::uno::Reference< css::uno::XComponentContext > m_xCtx;
- OUString * m_pOfficeBrandDir;
- OUString * m_pUserDir;
+ std::unique_ptr<OUString> m_pOfficeBrandDir;
+ std::unique_ptr<OUString> m_pUserDir;
};
} // namespace comphelper