Commit d3595434 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

Retain two autoreleased objects when putting them in scoped_nsobject.

Change-Id: I8017b1b14fa3d83abb2dfd3b59dc7ffcc84c0696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972290Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725962}
parent e1f5045e
......@@ -134,8 +134,10 @@ void AppShimController::FindOrLaunchChrome() {
if (!base::StringToInt(chrome_pid_string, &chrome_pid))
LOG(FATAL) << "Invalid PID: " << chrome_pid_string;
chrome_to_connect_to_.reset([NSRunningApplication
runningApplicationWithProcessIdentifier:chrome_pid]);
chrome_to_connect_to_.reset(
[NSRunningApplication
runningApplicationWithProcessIdentifier:chrome_pid],
base::scoped_policy::RETAIN);
if (!chrome_to_connect_to_)
LOG(FATAL) << "Failed to open process with PID: " << chrome_pid;
return;
......@@ -183,7 +185,8 @@ AppShimController::FindChromeFromSingletonLock(
// Open the associated pid. This could be invalid if Chrome terminated
// abnormally and didn't clean up.
base::scoped_nsobject<NSRunningApplication> process_from_lock(
[NSRunningApplication runningApplicationWithProcessIdentifier:pid]);
[NSRunningApplication runningApplicationWithProcessIdentifier:pid],
base::scoped_policy::RETAIN);
if (!process_from_lock) {
LOG(WARNING) << "Singleton lock pid " << pid << " invalid.";
return base::scoped_nsobject<NSRunningApplication>();
......
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