diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-03-28 19:17:53 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-03-28 19:20:53 +0900 |
commit | e3bd2ee4e00185d6e0e57aba7046634142d614b8 (patch) | |
tree | 02694526f8417518eabb5a2d2ddb22ed0faabb50 /editeng | |
parent | 8b533d84f3ae211fdfafc2adc8d8567f366771d4 (diff) |
Avoid possible resource leaks by boost::scoped_array
Change-Id: Ie20fc857f19f74aaccb546f9bfa11a7a657d3e8a
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 6fcf6f8f3064..0c1c867456a1 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -73,6 +73,7 @@ using namespace std; #include "editeng.hrc" #include <editeng/eerdll.hxx> #include <editeng/numitem.hxx> +#include <boost/scoped_array.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -1333,7 +1334,7 @@ namespace accessibility // build sorted index array sal_Int32 nLength = aRes.getLength(); const beans::PropertyValue* pPairs = aRes.getConstArray(); - sal_Int32* pIndices = new sal_Int32[nLength]; + boost::scoped_array<sal_Int32> pIndices(new sal_Int32[nLength]); sal_Int32 i = 0; for( i = 0; i < nLength; i++ ) pIndices[i] = i; @@ -1345,7 +1346,6 @@ namespace accessibility { pNewValues[i] = pPairs[pIndices[i]]; } - delete[] pIndices; return aNewValues; } |