Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Needs more info
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS

      Description

      {html}<div><p>I have reason to believe that the close event on a window
      happens before all its assets are released from memory. I'm doing
      this in the iPhone only. I'll explain below.</p>
      <p>I create a modal window, and use the url property:</p>
      <pre>
      <code>var searchModal = Ti.UI.createWindow({
      navBarHidden:true,
      url:'includes/search.js'
      });</code>
      </pre>
      <p><strong>search.js</strong> has about 400k in image assets and
      about 50k in JS includes (about a thousand lines of code total)
      inside it.</p>
      <p>When opening and closing the modal, I do the following:</p>
      <pre>
      <code>openButton.addEventListener('click',function(){
      searchModal.open();
      });</code>
      </pre>
      <p>Then inside <strong>search.js</strong>:<br></p>
      <pre>
      <code>closeButton.addEventListener('click',function(){
      searchModal.close();
      });</code>
      </pre>
      <p>If I open the modal, close it, then immediately click the open
      button again, the app crashes. I can make it crash over and over
      again. I put an event listener on the window close and notice that
      I'm clicking on the <em>openButton</em> after the 'close' event
      fires, and it still crashes.</p>
      <p>If I disable <strong>openButton</strong> once
      <strong>searchModal</strong> opens, then re-enable it on the window
      'close' event, I can still get it to crash. <em>However</em>, if I
      re-enable <strong>openButton</strong> after about a 1000ms delay, I
      can't ever get it to crash:</p>
      <pre>
      <code>searchModal.addEventListener('close',function(){
      setTimeout(function(){ openButton.enabled = true; },1000);
      });</code>
      </pre>
      <p>Please advise. Thank you!</p></div>{html}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ngupta Neeraj Gupta
                Reporter:
                cliftonlabrum Clifton Labrum
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-1563
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code