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

Unified Diff: content/browser/power_save_blocker_mac.cc

Issue 10832392: Fix leak in Mac PowerSaveBlocker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: content/browser/power_save_blocker_mac.cc
diff --git a/content/browser/power_save_blocker_mac.cc b/content/browser/power_save_blocker_mac.cc
index 543aace384a2fbc9165e17213752dcb645881571..c6244c2e94209dbd6316be6cc06bf530bcd64262 100644
--- a/content/browser/power_save_blocker_mac.cc
+++ b/content/browser/power_save_blocker_mac.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
+#include "base/mac/scoped_cftyperef.h"
#include "base/sys_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"
@@ -74,8 +75,12 @@ void PowerSaveBlocker::Delegate::ApplyBlock() {
break;
}
if (level) {
- IOReturn result = IOPMAssertionCreateWithName(level, kIOPMAssertionLevelOn,
- base::SysUTF8ToCFStringRef(reason_), &assertion_);
+ base::mac::ScopedCFTypeRef<CFStringRef> cf_reason(
+ base::SysUTF8ToCFStringRef(reason_));
+ IOReturn result = IOPMAssertionCreateWithName(level,
+ kIOPMAssertionLevelOn,
+ cf_reason,
+ &assertion_);
LOG_IF(ERROR, result != kIOReturnSuccess)
<< "IOPMAssertionCreate: " << result;
}
« 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