Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7854] iOS: WindowProxy not properly cleaned up in modal views

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-20T14:48:40.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsios, module_window, qe-testadded
ReporterSabil Rahim
AssigneeMax Stepanov
Created2012-02-29T15:10:23.000+0000
Updated2012-07-09T14:02:33.000+0000

Description

In the following code the windows opened are never cleared out from memory which can cause memory as well as orientation issues as we check the last window on the stack to find the current orientation.

Steps to reproduce

1. Run the app.js file in instruments. 2. search for TiUIwindowproxy 3. Click open on Blue window 4. Click open on Green window. 5. Click close on Red Window. 6. Repeat steps 4 & 5 , few times and finally click close on blue window. 7. Check the number of living WindowProxy.(It does not get Garbage Collected).

Expected Result:

When closing out the windows inside modal views the windowproxy should cleaned up.

Actual Result:

None of the windows opened inside modal views are cleaned up.
var toplevel = Ti.UI.createWindow({
	orientationModes:[
		Ti.UI.PORTRAIT,
		Ti.UI.UPSIDE_PORTRAIT
	],
	backgroundColor:'blue'
});

var win = Ti.UI.createWindow({
	orientationModes:[
		Titanium.UI.LANDSCAPE_LEFT,
		Titanium.UI.LANDSCAPE_RIGHT
	],
	backgroundColor:'green'
});



var b = Ti.UI.createButton({
	title:'open',
	width:100,
	height:50
});
b.addEventListener('click', function() {
	win.open({modal:true});
});

var b2 = Ti.UI.createButton({
	title:'open',
	width:100,
	height:50,
	top:20
});
b2.addEventListener('click', function() {
	var win2 = Ti.UI.createWindow({
	orientationModes:[Ti.UI.LANDSCAPE_RIGHT],
	backgroundColor:'red'
    });
    var b4 = Ti.UI.createButton({
	title:'close',
	width:100,
	height:50,
	bottom:20
    });
    win2.add(b4);
    b4.addEventListener('click', function() {
        win2.close();
    });

    
    
    
    win2.open();
});

var b3 = Ti.UI.createButton({
	title:'close',
	width:100,
	height:50,
	bottom:20
});
b3.addEventListener('click', function() {
	win.close();
});

var b4 = Ti.UI.createButton({
	title:'close',
	width:100,
	height:50,
	bottom:20
});
b4.addEventListener('click', function() {
	win2.close();
});

toplevel.add(b);
win.add(b2);
win.add(b3);


toplevel.open();

Comments

  1. Neeraj Gupta 2012-03-20

    This PR is on hold pending TIMOB-8070 resolution.
  2. Blain Hamon 2012-03-20

    Pull #1691 merged
  3. Dustin Hyde 2012-03-21

    Closing as Fixed. SDK: 2.0.0.v20120321161753 Studio: 2.0.0.201203202130 OS: Snow Leopard Devices Tested: iPhone4 4.3.5, iPad2 5.1

JSON Source