Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-435

UI Object Allocations with Alloy and Titanium Studio

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Runtime
    • Environment:

      Titanium Studio, build: 3.0.1.201211202043 or higher
      Titanium SDK Version: 3.0.0
      Titanium CLI Version: 3.0.16
      Alloy Version: 0.3.2

      Description

      The attached project has only 1 window and 1 view with 10 buttons so that you could see the UI count in allocations.

      In the attached screen1.png you will see view1 with the 10 buttons.

      In the attached screen2.png - If you click the remove myself button you will see that the view is removed and nulls the global reference to the view and you are returned to the window (white). I stayed on the window for a long time on a couple of tests and it never cleaned up the UI objects from view 1.

      In attached screen3.png I opened view1 and clicked the remove myself button and the objects where cleaned up almost instantly. I can repeat this action over and over again and the objects clean up flawlessly.

      This confirms that if you went to a view and never returned to it, it would never be properly cleaned up.

      Here is a link to the simplified project and made it as "hello world" as I could in hopes of making the issue easier to spot.

      http://wwww.appdesigngeeks.com/simpleviewtest.zip

      Below is the simplified code from Alloy.js that does the open and close of view1

      Alloy.globals.VARS =

      { globalParent: null, // Store ref to Parent Window of App globalCurrentView: null, // Store ref to current view being shown }

      ;

      Alloy.globals.GVUpdate = function(inName, inValue)

      { Alloy.globals.VARS[inName] = inValue; }

      ;

      Alloy.globals.GVOpenViewNew = function(viewName)

      { var openingview = Alloy.createController(viewName); // create controller Alloy.globals.VARS.globalParent.add(openingview.getView()); openingview.init(); Alloy.globals.VARS['globalCurrentView'] = openingview; }

      ;

      Alloy.globals.CloseView = function()

      { Alloy.globals.VARS.globalParent.remove(Alloy.globals.VARS.globalCurrentView.getView()); // Remove Current View from Parent Alloy.globals.GVUpdate("globalCurrentView", null); // Cleanup by Releasing resources and memory for current view }

      ;

        Attachments

        1. screen1 .png
          screen1 .png
          380 kB
        2. screen2.png
          screen2.png
          355 kB
        3. screen3.png
          screen3.png
          352 kB

          Activity

            People

            • Assignee:
              tlukasavage Tony Lukasavage
              Reporter:
              appdesigngeeks AppDesign
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration