mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42:53 +08:00
Clean up CallbackServer when about:blank page has loaded. This fixes errors when shutting down.
This commit is contained in:
parent
4280fdf252
commit
10e1808c56
@ -670,9 +670,6 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
// Forward to plugins
|
// Forward to plugins
|
||||||
this.pluginManager.onDestroy();
|
this.pluginManager.onDestroy();
|
||||||
|
|
||||||
if (this.callbackServer != null) {
|
|
||||||
this.callbackServer.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1065,7 +1062,9 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
// Try firing the onNativeReady event in JS. If it fails because the JS is
|
// Try firing the onNativeReady event in JS. If it fails because the JS is
|
||||||
// not loaded yet then just set a flag so that the onNativeReady can be fired
|
// not loaded yet then just set a flag so that the onNativeReady can be fired
|
||||||
// from the JS side when the JS gets to that code.
|
// from the JS side when the JS gets to that code.
|
||||||
|
if (!url.equals("about:blank")) {
|
||||||
appView.loadUrl("javascript:try{ PhoneGap.onNativeReady.fire();}catch(e){_nativeReady = true;}");
|
appView.loadUrl("javascript:try{ PhoneGap.onNativeReady.fire();}catch(e){_nativeReady = true;}");
|
||||||
|
}
|
||||||
|
|
||||||
// Make app view visible
|
// Make app view visible
|
||||||
appView.setVisibility(View.VISIBLE);
|
appView.setVisibility(View.VISIBLE);
|
||||||
@ -1081,6 +1080,13 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
this.ctx.clearHistory = false;
|
this.ctx.clearHistory = false;
|
||||||
this.ctx.appView.clearHistory();
|
this.ctx.appView.clearHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shutdown if blank loaded
|
||||||
|
if (url.equals("about:blank")) {
|
||||||
|
if (this.ctx.callbackServer != null) {
|
||||||
|
this.ctx.callbackServer.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user