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

UI Object Allocations with Alloy and Titanium Studio


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

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


      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.


      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 }



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



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


              • Created:

                Backbone Issue Sync

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

                  Git Integration