-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Remove Android WebView from view system before calling destroy() #1161
Description
Bug description:
React-native needs to remove WebView from the view hierarchy before calling .destroy(). From this comment it seems react-native is not doing so:
... W/cr_AwContents: WebView.destroy() called while WebView is still attached to window. ...
This probably isn't causing a crash (WebView tries to handle this case gracefully), but older versions of WebView may not handle this as gracefully (I've observed crashes on really old Android versions).
To Reproduce:
Not sure. This log message probably repros every time you trigger the cleanup code path.
Expected behavior:
The documentation states:
This method should be called after this WebView has been removed from the view system. No other methods may be called on this WebView after destroy.
https://developer.android.com/reference/android/webkit/WebView.html#destroy()
Screenshots/Videos:
N/A
Environment:
- OS: Android
- OS version: probably all
- react-native version:
- react-native-webview version: