ref #8: Fix npe on window disposal

This commit is contained in:
Tim Kluge 2024-12-15 22:21:47 +01:00
parent 20e4c8d3a4
commit a2ee609abc

View File

@ -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)
} }
} }