summaryrefslogtreecommitdiffstats
path: root/chrome/nacl
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 21:49:33 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 21:49:33 +0000
commit2a85a5f91d2deb56b00d189f435bc1d0cd998b8c (patch)
tree0d9449951bf5f9a4013fce2b15635ffbeef5d896 /chrome/nacl
parent5c8511c246eecc6dac870cbe250c2595e920bee5 (diff)
downloadchromium_src-2a85a5f91d2deb56b00d189f435bc1d0cd998b8c.zip
chromium_src-2a85a5f91d2deb56b00d189f435bc1d0cd998b8c.tar.gz
chromium_src-2a85a5f91d2deb56b00d189f435bc1d0cd998b8c.tar.bz2
nacl: Use a scoped_array rather than a bare pointer.
The bug was that we had a new[] without a matching delete[], using a scoped_array fixes this and simplifies the code. TEST=compiles Review URL: http://codereview.chromium.org/3410009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r--chrome/nacl/nacl_thread.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_thread.cc
index 77b78c7..c1ab76d 100644
--- a/chrome/nacl/nacl_thread.cc
+++ b/chrome/nacl/nacl_thread.cc
@@ -4,6 +4,7 @@
#include "chrome/nacl/nacl_thread.h"
+#include "base/scoped_ptr.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/nacl_messages.h"
@@ -37,10 +38,9 @@ void NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
}
void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
- NaClHandle* array = new NaClHandle[handles.size()];
+ scoped_array<NaClHandle> array(new NaClHandle[handles.size()]);
for (size_t i = 0; i < handles.size(); i++) {
array[i] = nacl::ToNativeHandle(handles[i]);
}
- NaClMainForChromium(static_cast<int>(handles.size()), array);
- delete array;
+ NaClMainForChromium(static_cast<int>(handles.size()), array.get());
}