Fix memory leak in app_controller_mac.mm.

Found by the Mac OS X 'leaks' tool; fixed on a plane.

BUG=292905

Review URL: https://chromiumcodereview.appspot.com/23503065

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223522 0039d316-1c4b-4281-b951-d872f2087c98
parent 2a9f7ae4
...@@ -169,12 +169,13 @@ void RecordLastRunAppBundlePath() { ...@@ -169,12 +169,13 @@ void RecordLastRunAppBundlePath() {
// or a unit test.) // or a unit test.)
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::FilePath appBundlePath = base::FilePath app_bundle_path =
chrome::GetVersionedDirectory().DirName().DirName().DirName(); chrome::GetVersionedDirectory().DirName().DirName().DirName();
base::ScopedCFTypeRef<CFStringRef> app_bundle_path_cfstring(
base::SysUTF8ToCFStringRef(app_bundle_path.value()));
CFPreferencesSetAppValue( CFPreferencesSetAppValue(
base::mac::NSToCFCast(app_mode::kLastRunAppBundlePathPrefsKey), base::mac::NSToCFCast(app_mode::kLastRunAppBundlePathPrefsKey),
base::SysUTF8ToCFStringRef(appBundlePath.value()), app_bundle_path_cfstring, BaseBundleID_CFString());
BaseBundleID_CFString());
// Sync after a delay avoid I/O contention on startup; 1500 ms is plenty. // Sync after a delay avoid I/O contention on startup; 1500 ms is plenty.
BrowserThread::PostDelayedTask( BrowserThread::PostDelayedTask(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment