{ "id": "84206", "key": "TIMOB-6847", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-05-26T14:10:15.000+0000", "created": "2011-12-22T11:34:23.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-26T14:10:15.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nCustomer discovered that setting a property to a table row directly will lead to leaks and setting it using the setter will not.\r\n\r\nh4. STEPS TO REPRODUCE\r\n1. Create new mobile project\r\n2. Paste the above leaking code into the app.js\r\n3. Run the app.\r\n\r\nh4. ACTUAL RESULTS\r\nThe app is leaking\r\n\r\nh4. EXPECTED RESULTS\r\nBeing able to modify values in the row without leaking\r\n\r\nh4. LEAKING CODE\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n orientationModes:[Ti.UI.PORTRAIT]\r\n });\r\n\r\nvar tableView = Titanium.UI.createTableView({});\r\nwin.add(tableView);\r\n\r\nfunction updateTable() {\r\n var data = [];\r\n for (var x=0; x< 10; x++) {\r\n var row = Ti.UI.createTableViewRow({\r\n className: \"DataRow\"\r\n });\r\n row.backgroundColor = \"#FF0000\";\r\n\r\n var label = Ti.UI.createLabel({\r\n text: \"Label: \" + x\r\n });\r\n\r\n row.add(label);\r\n data.push(row);\r\n }\r\n tableView.setData(data);\r\n}\r\n\r\nupdateTable();\r\nupdateTable();\r\n\r\nwin.open();\r\n{code}\r\n\r\nh4. NON-LEAKING CODE (using setter)\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n orientationModes:[Ti.UI.PORTRAIT]\r\n });\r\n\r\nvar tableView = Titanium.UI.createTableView({});\r\nwin.add(tableView);\r\n\r\nfunction updateTable() {\r\n\r\n var data = []; \r\n for (var x=0; x< 10; x++) {\r\n var row = Ti.UI.createTableViewRow({\r\n className: \"DataRow\"\r\n });\r\n row.setBackgroundColor(\"#FF0000\");\r\n\r\n var label = Ti.UI.createLabel({\r\n text: \"Label: \" + x\r\n });\r\n\r\n row.add(label);\r\n data.push(row);\r\n }\r\n tableView.setData(data);\r\n}\r\n\r\nupdateTable();\r\nupdateTable();\r\n\r\nwin.open();\r\n{code}\r\n\r\nh4. EXTRA INFO\r\nAs you see the only difference is\r\n\r\nrow.backgroundColor = \"#FF0000\";(leaking) \r\nVS\r\n\r\nrow.setBackgroundColor(\"#FF0000\");(not leaking)", "attachment": [], "flagged": false, "summary": "iOS: Setting a property directly to a TableViewRow will leak memory", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "comment": { "comments": [ { "id": "420505", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing this ticket as the issue cannot be reproduced with the following environment; \r\niPhone 7 (10.2) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.9.0.201705021158 \r\nTi SDK 6.1.0.v20170519131839 \r\nAppc NPM 4.2.9 \r\nAppc CLI 6.2.1 \r\nTi CLI 5.0.13 \r\nAlloy 1.9.11 \r\nArrow 2.0.0 \r\nXcode 8.2 (8C38) \r\nNode v4.8.2 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-26T14:10:15.000+0000", "updated": "2017-05-26T14:10:15.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }