summaryrefslogtreecommitdiff
path: root/comphelper/source/property/MasterPropertySet.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 08:50:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 11:29:53 +0000
commit54019e6601421baeda15ea331a07fd60ea1f7125 (patch)
tree750e5260ad505baf351e549d2367623854b6af36 /comphelper/source/property/MasterPropertySet.cxx
parent5fb99f271a571301f8246addae89738016926d6d (diff)
new loplugin: useuniqueptr: comphelper
Change-Id: Iafbaff60d10c9de7b57421e0c24809b08d813987 Reviewed-on: https://gerrit.libreoffice.org/33146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source/property/MasterPropertySet.cxx')
-rw-r--r--comphelper/source/property/MasterPropertySet.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx
index 9fbba145a14b..bd32900ab860 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -27,27 +27,25 @@
#include <osl/diagnose.h>
#include <memory>
+#include <vector>
class AutoOGuardArray
{
- std::unique_ptr< osl::Guard< comphelper::SolarMutex > > * mpGuardArray;
+ std::vector<std::unique_ptr< osl::Guard< comphelper::SolarMutex > >> maGuardArray;
public:
explicit AutoOGuardArray( sal_Int32 nNumElements );
~AutoOGuardArray();
- std::unique_ptr< osl::Guard< comphelper::SolarMutex > > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; }
+ std::unique_ptr< osl::Guard< comphelper::SolarMutex > > & operator[] ( sal_Int32 i ) { return maGuardArray[i]; }
};
-AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new std::unique_ptr< osl::Guard< comphelper::SolarMutex > >[nNumElements])
+AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : maGuardArray(nNumElements)
{
}
AutoOGuardArray::~AutoOGuardArray()
{
- //!! release unique_ptr's and thus the mutexes locks
- delete [] mpGuardArray;
-
}