Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5338)

Unified Diff: chrome/browser/system_monitor/portable_device_watcher_win.cc

Issue 11743008: Clean up: Use scoped_ptr<Foo[]> instead of scoped_array<Foo> in PortableDeviceWatcherWin::Enumerate… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comment Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/system_monitor/portable_device_watcher_win.cc
diff --git a/chrome/browser/system_monitor/portable_device_watcher_win.cc b/chrome/browser/system_monitor/portable_device_watcher_win.cc
index 60baedfdea4ba77d7782582acf4859852ad32870..bd326adf79082383620880e8088a759349fe8ef4 100644
--- a/chrome/browser/system_monitor/portable_device_watcher_win.cc
+++ b/chrome/browser/system_monitor/portable_device_watcher_win.cc
@@ -415,8 +415,7 @@ bool EnumerateAttachedDevicesOnBlockingThread(
if (FAILED(hr))
return false;
- scoped_array<char16*> pnp_device_ids(new char16*[pnp_device_count]);
- ZeroMemory(pnp_device_ids.get(), pnp_device_count);
+ scoped_ptr<char16*[]> pnp_device_ids(new char16*[pnp_device_count]);
hr = portable_device_mgr->GetDevices(pnp_device_ids.get(), &pnp_device_count);
if (FAILED(hr))
return false;
@@ -426,6 +425,7 @@ bool EnumerateAttachedDevicesOnBlockingThread(
if (GetDeviceInfoOnBlockingThread(
portable_device_mgr, pnp_device_ids[index], &device_details))
devices->push_back(device_details);
+ CoTaskMemFree(pnp_device_ids[index]);
}
return !devices->empty();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698