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

Unified Diff: base/sys_info_ios.mm

Issue 11188003: Fix some potential Mach port leaks from mach_host_self using a new ScopedMachPort class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 8 years, 2 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 | « base/process_util_mac.mm ('k') | base/sys_info_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_ios.mm
diff --git a/base/sys_info_ios.mm b/base/sys_info_ios.mm
index 8b1ffd4521192f0f9db7e9c2b3b6621a4e6d1838..1ee0e545e3ee5054b10e7f7858d78f2577fe4b1b 100644
--- a/base/sys_info_ios.mm
+++ b/base/sys_info_ios.mm
@@ -10,6 +10,7 @@
#include <sys/types.h>
#include "base/logging.h"
+#include "base/mac/scoped_mach_port.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/sys_string_conversions.h"
@@ -55,7 +56,8 @@ void SysInfo::OperatingSystemVersionNumbers(int32* major_version,
int64 SysInfo::AmountOfPhysicalMemory() {
struct host_basic_info hostinfo;
mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
- int result = host_info(mach_host_self(),
+ base::mac::ScopedMachPort host(mach_host_self());
+ int result = host_info(host,
HOST_BASIC_INFO,
reinterpret_cast<host_info_t>(&hostinfo),
&count);
« no previous file with comments | « base/process_util_mac.mm ('k') | base/sys_info_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698