Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13620

Android: Proxies in modules are not disposed correctly

    Details

      Description

      The app.js in the example folder demonstrates the issue:

      1. Unzip the module
      2. Build the module ('ant')
      3. Create a new Titanium application in Studio
      4. Copy the app.js from the module's example folder into your application
      5. Run the application
      6. Notice that the label displays 'Jeff 555-1212'. The 'Jeff' comes from the propertyAccessor and the '555-1212' comes from the custom property.
      7. Hit the Android Back button (the activity closes but the process is still active)
      8. Tap on the application in the Android app launcher
      9. Notice that the label displays 'undefined 555-1212'. You can also see the 'E/Proxy ( 2221): Unable to lookup Proxy.prototype.getProperty' error message in the log.

      For further weirdness, uncomment lines 29-31 in the app.js file and re-run steps 5-8 again. This time you will notice that everything works correctly. The only difference here is that a 2nd instance of the proxy is being created with a call from JS rather than the one that is being created internally.

      A couple of observations:
      The onStop and onDestroy methods are getting called when the activity closes (check the messages output to the log file)
      The process is still active after closing the activity
      On the 2nd launch of the main activity you will notice a log message that it is registering an existing module again even though the module was supposedly destroyed. Probably expected behavior, but perhaps not.
      I've tried a number of different things but have not been able to change this behavior. Any clues, suggestions, etc. are greatly appreciated.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshroesslein Josh Roesslein
                Reporter:
                ayeung Allen Yeung
                Reviewer:
                Allen Yeung
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code