PROBLEM DESCRIPTION
Customer discovered that setting a property to a table row directly will lead to leaks and setting it using the setter will not.
STEPS TO REPRODUCE
1. Create new mobile project
2. Paste the above leaking code into the app.js
3. Run the app.
ACTUAL RESULTS
The app is leaking
EXPECTED RESULTS
Being able to modify values in the row without leaking
LEAKING CODE
var win = Ti.UI.createWindow({
orientationModes:[Ti.UI.PORTRAIT]
});
var tableView = Titanium.UI.createTableView({});
win.add(tableView);
function updateTable() {
var data = [];
for (var x=0; x< 10; x++) {
var row = Ti.UI.createTableViewRow({
className: "DataRow"
});
row.backgroundColor = "#FF0000";
var label = Ti.UI.createLabel({
text: "Label: " + x
});
row.add(label);
data.push(row);
}
tableView.setData(data);
}
updateTable();
updateTable();
win.open();
NON-LEAKING CODE (using setter)
var win = Ti.UI.createWindow({
orientationModes:[Ti.UI.PORTRAIT]
});
var tableView = Titanium.UI.createTableView({});
win.add(tableView);
function updateTable() {
var data = [];
for (var x=0; x< 10; x++) {
var row = Ti.UI.createTableViewRow({
className: "DataRow"
});
row.setBackgroundColor("#FF0000");
var label = Ti.UI.createLabel({
text: "Label: " + x
});
row.add(label);
data.push(row);
}
tableView.setData(data);
}
updateTable();
updateTable();
win.open();
EXTRA INFO
As you see the only difference is
row.backgroundColor = "#FF0000";(leaking)
VS
row.setBackgroundColor("#FF0000");(not leaking)
Closing this ticket as the issue cannot be reproduced with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705021158 Ti SDK 6.1.0.v20170519131839 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80