summaryrefslogtreecommitdiff
path: root/sfx2/source/control/bindings.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-24 03:09:23 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-24 03:10:18 +0900
commitf516cff220895391c861adf1f4e93e280e1c3a17 (patch)
tree090c2c32ab91b27a49fb8de162e5c95faea5e6f2 /sfx2/source/control/bindings.cxx
parent970517af3e02e6c05e4d2b44d63745e8a414bb43 (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: I7b72c5680d5665b3f1f720f50a2d3ea6fc0c3e39
Diffstat (limited to 'sfx2/source/control/bindings.cxx')
-rw-r--r--sfx2/source/control/bindings.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index b1f3440c16ff..9954f9ec1a77 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -64,7 +64,7 @@
#include <sfx2/msgpool.hxx>
#include <com/sun/star/frame/XModuleManager.hpp>
-
+#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -1451,7 +1451,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
}
// Create a Set from the ranges
- sal_uInt16 *pRanges = new sal_uInt16[rFound.size() * 2 + 1];
+ boost::scoped_array<sal_uInt16> pRanges(new sal_uInt16[rFound.size() * 2 + 1]);
int j = 0;
sal_uInt16 i = 0;
while ( i < rFound.size() )
@@ -1464,8 +1464,8 @@ SfxItemSet* SfxBindings::CreateSet_Impl
pRanges[j++] = rFound[i++]->nWhichId;
}
pRanges[j] = 0; // terminating NULL
- SfxItemSet *pSet = new SfxItemSet(rPool, pRanges);
- delete [] pRanges;
+ SfxItemSet *pSet = new SfxItemSet(rPool, pRanges.get());
+ pRanges.reset();
DBG_PROFSTOP(SfxBindingsCreateSet);
return pSet;
}