Skip to content

Commit

Permalink
fixed to set mWebView = null in ui thread (mWebView should always be …
Browse files Browse the repository at this point in the history
…modifed in UI thread). (gree#997)
  • Loading branch information
KojiNakamaru authored Oct 22, 2023
1 parent 343c17b commit 23a2807
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,12 @@ public void onGlobalLayout() {

public void Destroy() {
final Activity a = UnityPlayer.currentActivity;
final WebView webView = mWebView;
mWebView = null;
if (CWebViewPlugin.isDestroyed(a)) {
return;
}
a.runOnUiThread(new Runnable() {public void run() {
final WebView webView = mWebView;
mWebView = null;
if (webView == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,13 +908,13 @@ private File createImageFile() throws IOException {
public void Destroy() {
final Activity a = UnityPlayer.currentActivity;
final CWebViewPlugin self = this;
final WebView webView = mWebView;
mWebView = null;
mMessages.clear();
if (CWebViewPlugin.isDestroyed(a)) {
return;
}
a.runOnUiThread(new Runnable() {public void run() {
final WebView webView = mWebView;
mWebView = null;
if (webView == null) {
return;
}
Expand Down

0 comments on commit 23a2807

Please sign in to comment.