[TIMOB-9494] iOS:UI.iPhone.NavigationGroup - Opening window added in the Navgroup shows an intermittent behavior while allocating and de-allocating the memory.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-07-10T22:33:01.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Sprint 2012-14 API |
Components | iOS |
Labels | api, qe-ios060112 |
Reporter | Neha Chhabra |
Assignee | Eric Merriman |
Created | 2012-06-12T03:12:22.000+0000 |
Updated | 2017-07-10T22:33:06.000+0000 |
Description
Opening window added in the Navgroup shows an intermittent behavior while allocating and de-allocating the memory.
This is not a regression.This occurs as far as 1.8.2.
Steps to Reproduce:
1. Install the app on device and launch it.
2. Open Developer/Applications/Instruments (Xcode Memory Profiler).
3. Run the app through the profiler (monitor leaks).
4. Choose Target -> Device, and Choose Target -> Choose Target -> App. Press record to run the app.
5. Open each tab in the window (One, Two, Three), and close using the Close button.
6. Open each tab in the window (One, Two, Three), and close using the Home Window button in the nav bar at the top.
app.js
var _window = Ti.UI.createWindow({
backgroundColor : 'blue'
})
// Global namespace
var App = {};
// used to simulate global object
var Global = {};
// Initial Window
App.homeWindow = Ti.UI.createWindow({
title: 'Home Window'
});
// NavGroup
App.nav = Ti.UI.iPhone.createNavigationGroup({
window: App.homeWindow
});
// Module loader / helper
App.loadPage = function(_name, _params) {
// Private
var win = Ti.UI.createWindow({ backgroundColor: '#eee' }),
scrollable = Ti.UI.createScrollableView(),
close = null;
// simluate exports object
Global.exports = {};
// Public
Global.exports.load = function(_app, _params) {
win.title = _params.title;
close = Ti.UI.createButton({
title: 'close',
width: '50%',
height: 75
});
// Closing the window means it will never get released
// NOTE: It will get released if you hit the auto generated back button.
close.addEventListener('click', function() {
_app.nav.close(win);
// None of these free up memory:
win = null;
scrollable = null;
Global.exports = null;
});
win.add(scrollable);
win.add(close);
_app.nav.open(win);
};
Global.exports.load(App, _params);
};
/**
* Initial page
*/
var data = [
{ title: 'One' },
{ title: 'Two' },
{ title: 'Three' },
];
var table = Ti.UI.createTableView({
data: data
});
table.addEventListener('click', function(e) {
App.loadPage('someModule', {
title: e.row.title
});
});
App.homeWindow.add(table);
_window.add(App.nav);
_window.open();
Actual Result:
At Step 6:The TiUIWindowPoxy variable is not deallocating the memory when windows closes.
Also,sometimes it is not even allocating the memory to the variable
Expected Result:
The TiUIWindowPoxy variable should be deallocated when windows close.
Tested on iPhone Simulator 4.3, 5.0 and 5.1, on device iPhone 4S running 5.1 SDK build : 2.2.0 (master) build cf6f1330469d2238a5ca8f9f374e1312e51fdbe7. Mac OSX 10.7.3
Tested with: Titanium Studio: 2.1.2.201208201549 Titanium SDK: 2.1.2.v20120821160113 Titanium SDK: 2.2.0.v20120808154112 The problem of deallocation the memory still occurs.(i.e after following all the steps,one extra living is left for TiUiWindowProxy)
I'm also experiencing this issue with 2.1.1 GA
Closing ticket due to time passed and lack of progress for a number of years. Please open a new ticket if there are any problems.