Details

      Description

      When closing a webview, memory is not released properly. Removing the webview and nulling variables does not solve the problem.

      App.js:

      (function() {	
      	var w = Ti.UI.createWindow();
      	w.exitOnClose = true;
      	w.setBackgroundColor("red");
      	w.setNavBarHidden(true);
      	
      	var b = Ti.UI.createButton();
      	b.setTitle("Press me");
      	b.addEventListener('click', function()
      	{
      	   var w2 = Ti.UI.createWindow();
      	   w2.setModal(true);
      	   w2.setNavBarHidden(true);
      	   w2.setBackgroundColor("white");
      	   
      	   var l = Titanium.UI.createWebView({
      		  html:'hello world'
      	   });
      	   w2.add(l);
      	   w2.addEventListener('android:back', function(e){
      	   	   w2.remove(l);  
      	   	   l = null;
      	   	   w2.close();	  
      	   	   w2 = null; 	  
      		});
      	   w2.open();
      	});
      	
      	w.add(b);	
      	w.open();	
      })();
      

      Steps to reproduce:

      1) Launch app and check memory used (aprox 16mb)
      2) Click the button to open the new window with the webview
      3) Close the window with back button and check memory used (22mb)
      4) Repeat steps 1-3. Every time window with webview is opened and closed,
      memory used is increased by aprox 1mb.

        Attachments

          Activity

            People

            • Assignee:
              ayeung Allen Yeung
              Reporter:
              clathrop Carter Lathrop
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration