{ "id": "121314", "key": "TIMOB-15906", "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": null, "resolutiondate": null, "created": "2013-10-17T11:07:12.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:03.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. Problem Description\r\nWhen a window is closed, the NavBarButtons should be removed, as well as other objects in the window. \r\n\r\nh4. Steps to reproduce\r\n# Create a new mobile project\r\n# Add this to app.js\r\n{code:javascript}\r\nvar win2 = Titanium.UI.createWindow({\r\n backgroundColor: 'red',\r\n title: 'Red Window'\r\n});\r\n \r\nvar win1 = Titanium.UI.iOS.createNavigationWindow({\r\n window: win2\r\n});\r\n \r\n \r\nwin2.addEventListener(\"click\", function(){\r\n var leftOne = Ti.UI.createButton({\r\n systemButton: Ti.UI.iPhone.SystemButton.DONE\r\n });\r\n \r\n var rightOne = Ti.UI.createButton({\r\n systemButton: Ti.UI.iPhone.SystemButton.DONE\r\n });\r\n \r\n \r\n var blueWin = Ti.UI.createWindow({\r\n leftNavButton: leftOne,\r\n rightNavButton: rightOne,\r\n backgroundColor: \"blue\"\r\n });\r\n \r\n \r\n var closeBlueWin = Titanium.UI.createButton({\r\n title: 'Close Blue Window'\r\n });\r\n \r\n closeBlueWin.addEventListener('click', function(){\r\n win1.closeWindow(blueWin);\r\n });\r\n \r\n blueWin.add(closeBlueWin);\r\n win1.openWindow(blueWin);\r\n});\r\n \r\n \r\nwin1.open();\r\n{code}\r\n# Run this in instruments, the memory only grows as you can see in the attached image. \r\n\r\nh4. Extra information \r\nForum: http://developer.appcelerator.com/question/158445/navbarbutton-memory-leak", "attachment": [ { "id": "43262", "filename": "Sn_mka_obrazovky_2013_10_16_o_12_47_58_PM.png", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-17T11:07:12.000+0000", "size": 46096, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: NavBarButton memory leak", "creator": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 7, 3.1.3.GA", "comment": { "comments": [ { "id": "276274", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\r\n\r\nYou need to clean the elements by yourself. Check this:\r\n\r\nhttps://gist.github.com/mauropm/5923980\r\n\r\nBest,\r\n\r\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-10-22T23:30:34.000+0000", "updated": "2013-10-22T23:30:34.000+0000" }, { "id": "276276", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The first thing which I have tried was:\n\n{code:javascript}\nblueWin.remove(leftOne);\nleftOne = null;\n{code}\n\nBut it didn't work. I will try it again... Anyway why those buttons are not removed automatically after win.close()? Normal button in the window is removed...", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-22T23:47:07.000+0000", "updated": "2013-10-22T23:47:07.000+0000" }, { "id": "276930", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Alright, so I have tried it again and basically it doesn't work for me. Please if this is not a bug can you provide me some solution that work? \r\n\r\n*As I asked above why those buttons are not removed automatically same as normal button in the window? I think they have to be removed by win.close() otherwise if I have to remove every time, every navButton from different window (+another objects) that is very annoying process.\r\n\r\nThanks\r\n\r\n\r\n{code:javascript}\r\n closeBlueWin.addEventListener('click', function(){\r\n win1.closeWindow(blueWin);\r\n \r\n blueWin.remove(leftOne); //[WARN] : Called remove for [object TiUIButton] on [object TiUIWindow], but [object TiUIButton] isn't a child or has already been removed.\r\n blueWin.remove(rightOne);\r\n \r\n leftOne = null;\r\n rightOne = null;\r\n blueWin = null;\r\n });\r\n{code}", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-27T17:11:28.000+0000", "updated": "2013-10-27T17:13:36.000+0000" }, { "id": "277096", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\n\ndid you remove the events listeners for the buttons?\n\nBEst,\n\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-10-29T01:49:14.000+0000", "updated": "2013-10-29T01:49:14.000+0000" }, { "id": "277125", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As you can see above navBarButtons don't have any eventListeners.", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-29T10:57:08.000+0000", "updated": "2013-10-29T10:57:08.000+0000" }, { "id": "277202", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello Matej,\nhow do you know that the memory is leaking? How did you test it?\n\nBest,\n\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-10-29T18:32:10.000+0000", "updated": "2013-10-29T18:32:10.000+0000" }, { "id": "277205", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You can see it in the picture above (In attachments). Count of NavBarButton is increasing every time when is window opened and it never decrease after win.close(). Normal button that is in the window is alright, only navButtons doesn't work properly...\r\n\r\n*For test you can use Instruments from Xcode", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-29T18:36:51.000+0000", "updated": "2013-10-29T18:38:55.000+0000" }, { "id": "277516", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Will this issue opened or not?", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-31T17:33:56.000+0000", "updated": "2013-10-31T17:33:56.000+0000" }, { "id": "278523", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "???", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-06T22:45:42.000+0000", "updated": "2013-11-06T22:45:42.000+0000" }, { "id": "280969", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Invalid issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:18:25.000+0000", "updated": "2013-11-24T22:18:25.000+0000" }, { "id": "281079", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Mauri, please if this issue is invalid can you provide some solution? As you can see above I tried a lot of things and basically it doesn't work. If you don't have any solution I think this is not invalid... Thank you", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-24T23:29:50.000+0000", "updated": "2014-01-16T09:16:28.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }