{ "id": "90791", "key": "TIMOB-8932", "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": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13405", "description": "Sprint 2012-09 API", "name": "Sprint 2012-09 API", "archived": true, "released": true, "releaseDate": "2012-05-06" } ], "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": "2012-05-04T13:56:44.000+0000", "created": "2012-04-24T02:52:42.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T17:29:46.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": "the following example allows for multiple open/close of the tabGroup - and each time, the number of proxys increase and are never reduced. Also, the actual references (TiUIView, TiUITabController, TiUIWindow) increase and never reduce.\r\n\r\n\r\nExample Code:\r\n// app.js\r\n \r\nvar oxi={};\r\nTi.include('appframework.js');\r\n \r\n(function(){\r\n var win = Ti.UI.createWindow();\r\n var mainUI;\r\n\r\n function terminateUI() {\r\n mainUI.close();\r\n mainUI = null;\r\n Ti.App.removeEventListener('terminateUI', terminateUI);\r\n win.open();\r\n };\r\n \r\n function launch() {\r\n win.close();\r\n \r\n mainUI = oxi.ui.createMainUI();\r\n Ti.App.addEventListener('terminateUI', terminateUI);\r\n mainUI.open();\r\n } \r\n \r\n win.addEventListener('click',launch);\r\n win.open();\r\n})();\r\n \r\n// appframework.js\r\n \r\n(function(){\r\n oxi.ui = {};\r\n \r\n oxi.ui.createMainUI = function() {\r\n var tabGroup = Ti.UI.createTabGroup();\r\n \r\n var tab1 = Ti.UI.createTab({\r\n title:'Library',\r\n window: Ti.UI.createWindow({\r\n navBarHidden: true\r\n })\r\n });\r\n \r\n var tab2 = Ti.UI.createTab({\r\n title:'Settings',\r\n window: Ti.UI.createWindow({\r\n navBarHidden: true\r\n })\r\n });\r\n \r\n tab1.window.add(Titanium.UI.createView({\r\n backgroundColor: '#ffc'\r\n }));\r\n \r\n tab2.window.add(Titanium.UI.createView({\r\n backgroundColor: '#ffc'\r\n }));\r\n \r\n tabGroup.addTab(tab1);\r\n tabGroup.addTab(tab2);\r\n \r\n tab1.window.addEventListener('click',function(e){\r\n Ti.API.info('clicked on win1');\r\n Ti.App.fireEvent('terminateUI');\r\n });\r\n \r\n return tabGroup; \r\n };\r\n})();\r\n\r\nBy changing the terminateUI() function to the following, all references and proxies are removed, except the one for win (intentional, as it is not set to null) and the one for mainUI (unintentional, as it is set to null explicitly after closing the tabGroup):\r\n\r\nfunction terminateUI() {\r\n for (var tab=mainUI.tabs.length-1;tab>-1;--tab) {\r\n mainUI.removeTab(mainUI.tabs[tab]);\r\n }\r\n mainUI.close();\r\n mainUI = null;\r\n Ti.App.removeEventListener('terminateUI', terminateUI);\r\n win.open();\r\n};\r\n\r\nFor subsequent runs (the code allows for open/close multiple times of the tabGroup) the proxy for the tabGroup is cleared - however, the FIRST proxy is never disposed of.", "attachment": [], "flagged": false, "summary": "iOS: Memory leak with tabGroup", "creator": { "name": "mortenfthomsen", "key": "mortenfthomsen", "displayName": "Morten F. Thomsen", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mortenfthomsen", "key": "mortenfthomsen", "displayName": "Morten F. Thomsen", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS Simulator, iOS SDK 5.1\r\nTitanium SDK: 2.0.1.GA2\r\nOSX Lion", "comment": { "comments": [ { "id": "193793", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot Reproduce. \r\n\r\nTried Reproducing with master 2.0.1.848d711 on Xcode 4.3 running 5.1 sim on Lion.\r\n\r\nNOTE : i did see \"tabgrouproxy\" still staying around but after doing a \"Simulate Memory Warning\" on Simulator and it went away. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-04T13:56:20.000+0000", "updated": "2012-05-04T13:56:20.000+0000" }, { "id": "416511", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce the issue using the following environment; \r\niPhone 7 (10.2) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.3 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T17:29:46.000+0000", "updated": "2017-03-31T17:29:46.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }