diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-30 15:46:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-30 15:55:00 +0200 |
commit | 63405c050050b4f2ea2ba922e7031e2c0b5d3621 (patch) | |
tree | fb3fe0aa51aa48bb548d5f1cb4da6a9ec905fa78 /connectivity | |
parent | 4bd5d16381442fc94b6beecd6c16dd15686be924 (diff) |
Fix memory leak
Change-Id: I0e5c3af0504f3090a5db7692c6bfb1d33b3aa81f
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mork/MNSProfileDiscover.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MNSProfileDiscover.hxx | 15 |
2 files changed, 8 insertions, 15 deletions
diff --git a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx index 4b7ac559f5e7..87c064cbce99 100644 --- a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx +++ b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx @@ -122,10 +122,9 @@ namespace connectivity fullProfilePath = profilePath; } - ProfileStruct* profileItem = new ProfileStruct(product,profileName, + m_Product.mProfileList[profileName] = ProfileStruct(product,profileName, fullProfilePath ); - m_Product.mProfileList[profileName] = profileItem; sal_Int32 isDefault = 0; if (!sIsDefault.isEmpty()) @@ -151,7 +150,7 @@ namespace connectivity return OUString(); } else - return m_Product.mProfileList[profileName]->getProfilePath(); + return m_Product.mProfileList[profileName].getProfilePath(); } OUString ProfileAccess::getDefaultProfile( ::com::sun::star::mozilla::MozillaProductType product ) throw (::com::sun::star::uno::RuntimeException) @@ -168,8 +167,7 @@ namespace connectivity //there are not any profiles return OUString(); } - ProfileStruct * aProfile = (*m_Product.mProfileList.begin()).second; - return aProfile->getProfileName(); + return (*m_Product.mProfileList.begin()).second.getProfileName(); } } } diff --git a/connectivity/source/drivers/mork/MNSProfileDiscover.hxx b/connectivity/source/drivers/mork/MNSProfileDiscover.hxx index 26a8eceae12d..5ae56886ccaf 100644 --- a/connectivity/source/drivers/mork/MNSProfileDiscover.hxx +++ b/connectivity/source/drivers/mork/MNSProfileDiscover.hxx @@ -34,14 +34,7 @@ #include "dllapi.h" using namespace com::sun::star::mozilla; -namespace connectivity -{ - namespace mork - { - class ProfileStruct; - } -} -typedef ::std::map < OUString, ::connectivity::mork::ProfileStruct* > ProfileList; + namespace connectivity { namespace mork @@ -49,8 +42,8 @@ namespace connectivity class ProfileStruct { public: - ProfileStruct(MozillaProductType aProduct, const OUString& aProfileName, - const OUString &aProfilePath + ProfileStruct(MozillaProductType aProduct = MozillaProductType_Default, const OUString& aProfileName = OUString(), + const OUString &aProfilePath = OUString() ); MozillaProductType getProductType() { return product;} OUString getProfileName(){ return profileName;} @@ -61,6 +54,8 @@ namespace connectivity OUString profilePath; }; + typedef ::std::map < OUString, ProfileStruct > ProfileList; + class ProductStruct { public: |