ref #8: Fix npe on window disposal
This commit is contained in:
parent
20e4c8d3a4
commit
a2ee609abc
@ -240,9 +240,9 @@ class Window(
|
|||||||
serviceJob?.cancel()
|
serviceJob?.cancel()
|
||||||
(context.getSystemService(WINDOW_SERVICE) as WindowManager).removeView(rootView)
|
(context.getSystemService(WINDOW_SERVICE) as WindowManager).removeView(rootView)
|
||||||
rootView.invalidate()
|
rootView.invalidate()
|
||||||
(rootView.parent as ViewGroup).removeAllViews()
|
(rootView.parent as? ViewGroup)?.removeAllViews()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.d(TAG, e.toString())
|
Log.e(TAG, "Failed to dispose window", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user