From 9b34a553edce1f7be4679f8c59a282de828df652 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Tue, 9 Feb 2016 23:06:13 -0500 Subject: [PATCH] Just log an error instead of crashing when view state is messed up --- .../main/java/acr/browser/lightning/view/LightningView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/acr/browser/lightning/view/LightningView.java b/app/src/main/java/acr/browser/lightning/view/LightningView.java index 86734fc..990a111 100644 --- a/app/src/main/java/acr/browser/lightning/view/LightningView.java +++ b/app/src/main/java/acr/browser/lightning/view/LightningView.java @@ -791,7 +791,8 @@ public class LightningView { // before calling destroy() so that a memory leak is not created ViewGroup parent = (ViewGroup) mWebView.getParent(); if (parent != null) { - throw new RuntimeException("WebView was not detached from window before onDestroy"); + Log.e(Constants.TAG, "WebView was not detached from window before onDestroy"); + parent.removeView(mWebView); } mWebView.stopLoading(); mWebView.onPause();