From 4f7ba30690438d69c75c92530e7a78bd20fa9a24 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 14 Oct 2019 23:45:10 -0700 Subject: [PATCH] Enforce super destroy for webviews --- .../kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index de4e414b8..b76f01341 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -211,10 +211,7 @@ class FrostWebView @JvmOverloads constructor( } override fun destroy() { - val parent = getParent() as? ViewGroup - if (parent != null) { - parent.removeView(this) - super.destroy() - } + (getParent() as? ViewGroup)?.removeView(this) + super.destroy() } }