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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_delegate.cc

Issue 2501793002: Prevent the browser from crashing when exiting pages that use WebVR. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_delegate.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
index d324bde0afc51fbbb61f058fbdc0d89d90d1404c..04afe1c512bfee1c83ee5d2d9235c04a5978e9cf 100644
--- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -104,10 +104,12 @@ base::WeakPtr<device::GvrDelegate> VrShellDelegate::GetNonPresentingDelegate() {
}
void VrShellDelegate::DestroyNonPresentingDelegate() {
- non_presenting_delegate_.reset(nullptr);
- JNIEnv* env = AttachCurrentThread();
- Java_VrShellDelegate_shutdownNonPresentingNativeContext(
- env, j_vr_shell_delegate_.obj());
+ if (non_presenting_delegate_) {
+ non_presenting_delegate_.reset(nullptr);
+ JNIEnv* env = AttachCurrentThread();
+ Java_VrShellDelegate_shutdownNonPresentingNativeContext(
+ env, j_vr_shell_delegate_.obj());
+ }
}
// ----------------------------------------------------------------------------
« no previous file with comments | « no previous file | device/vr/android/gvr/gvr_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698