Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9519

Inappropriate destruction time of engine in CordovaWebViewImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • None
    • None
    • cordova-android
    • None

    Description

      In CordovaWebViewImpl.java, one of the TODO comments in public void handleDestroy() method points out that the engine should not destroy webview until after about:blank is done loading. Actually, the engine has indeed been destroyed before about:blank is completely loaded, which causes some problems.

      I think moving a line of code may work:

      engine.destroy();

      This code can be moved into the last if block in public void onPageFinishedLoading(String url), like this:

                  // Shutdown if blank loaded
                  if (url.equals("about:blank")) {
                      engine.destroy();
                      pluginManager.postMessage("exit", null);
                  }
      

      Since before destroying the engine, we have set the URL to be about:blank, so destroying it when about:blank is completed loaded can work.

      Attachments

        Activity

          People

            Unassigned Unassigned
            donghl Dong Hanlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: