summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-03-11 09:24:30 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-03-11 09:30:49 +0900
commit59b428189d14da78e761c8dbb8bd8ba7de4fa511 (patch)
tree2b9c0c9fe9c917a87538173820e92f0631f4e961 /vcl/source/app
parentbad51b0613db4a9152ffebe43a74a83af42d532b (diff)
Avoid possible resource leaks by boost::scoped_array
Change-Id: I3a9131d75690e18caec4c328934735a9ca19e7ca
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/dbggui.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index ac2cdd072f28..81c32b247a18 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -58,6 +58,7 @@
#include <map>
#include <algorithm>
+#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -1090,8 +1091,8 @@ void DbgDialogTest( Window* pWindow )
if ( !pGetChild )
return;
- Rectangle* pRectAry = (Rectangle*)new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)];
- memset( pRectAry, 0, sizeof(Rectangle)*nChildCount );
+ boost::scoped_array<Rectangle> pRectAry((Rectangle*)new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)]);
+ memset( pRectAry.get(), 0, sizeof(Rectangle)*nChildCount );
if ( pWindow->IsDialog() )
{
@@ -1433,8 +1434,6 @@ void DbgDialogTest( Window* pWindow )
pGetChild = pGetChild->GetWindow( WINDOW_NEXT );
i++;
}
-
- delete [] pRectAry;
}
#ifndef WNT