android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |    6 
++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9497681bd98d5cfc70a914e8e79e00a527813cdd
Author:     Jan Holesovsky <ke...@collabora.com>
AuthorDate: Wed Feb 12 21:49:17 2020 +0100
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Wed Feb 12 21:52:55 2020 +0100

    android: Avoid a WebView-related error in the log.
    
    Namely "WebView.destroy() called while WebView is still attached to window".
    
    Change-Id: I6963a553ac05af6426ffe3c054bdcff28a725e3b
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88571
    Tested-by: Jan Holesovsky <ke...@collabora.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index a964ad392..90021f1c6 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -35,6 +35,7 @@ import android.provider.DocumentsContract;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.webkit.JavascriptInterface;
 import android.webkit.ValueCallback;
@@ -460,6 +461,11 @@ public class LOActivity extends AppCompatActivity {
         super.onDestroy();
         Log.i(TAG, "onDestroy() - we know we are leaving the document");
         nativeLooper.quit();
+
+        // Remove the webview from the hierarchy & destroy
+        final ViewGroup viewGroup = (ViewGroup) mWebView.getParent();
+        if (viewGroup != null)
+            viewGroup.removeView(mWebView);
         mWebView.destroy();
 
         // Most probably the native part has already got a 'BYE' from
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to