[TIMOB-7854] iOS: WindowProxy not properly cleaned up in modal views
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-20T14:48:40.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | iOS |
Labels | ios, module_window, qe-testadded |
Reporter | Sabil Rahim |
Assignee | Max Stepanov |
Created | 2012-02-29T15:10:23.000+0000 |
Updated | 2012-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();
This PR is on hold pending TIMOB-8070 resolution.
Pull #1691 merged
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