{ "id": "169017", "key": "TIMOB-25051", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-14T00:30:37.000+0000", "created": "2017-07-19T12:44:38.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "19870", "description": "", "name": "Release 6.1.2", "archived": false, "released": true, "releaseDate": "2017-08-03" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-11-15T06:26:37.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "https://github.com/appcelerator/titanium_mobile/blob/6_1_X/android/modules/network/src/js/network.js#L16\r\nhttps://github.com/appcelerator/titanium_mobile/blob/6_1_X/android/modules/network/src/js/network.js#L27\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/6_1_X/android/modules/ui/src/js/ui.js#L18\r\nhttps://github.com/appcelerator/titanium_mobile/blob/6_1_X/android/modules/ui/src/js/ui.js#L29\r\n\r\nObjects references should not be deleted by \"splice\", because they might be disposed not in the same order what they were stored.\r\n", "attachment": [], "flagged": false, "summary": "Android. persistentObjects leak", "creator": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "subtasks": [], "reporter": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "environment": null, "comment": { "comments": [ { "id": "424365", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "I suggest to replace current realisation with something like this:\r\n{code:javascript}\r\n// Keeps an object alive until dispose() is called.\r\n// This is currently used to keep \"top level\" objects\r\n// (ex: windows, tab groups) alive until their lifecycle ends.\r\nfunction PersistentHandle(object) {\r\n\tthis.cell = PersistentHandle.lastId++;\r\n\tPersistentHandle.objects[this.cell] = object;\r\n}\r\n\r\n// Objects retained by persistent handles.\r\n// Each element in this array acts as a storage \"cell\"\r\n// keeping the object reachable and alive until it is removed.\r\nPersistentHandle.objects = {};\r\n\r\nPersistentHandle.lastId = 0;\r\n\r\nPersistentHandle.prototype.dispose = function() {\r\n\tif (this.cell == -1) {\r\n\t\t// This handle has already been disposed.\r\n\t\treturn;\r\n\t}\r\n\r\n\tdelete PersistentHandle.objects[this.cell];\r\n\tthis.cell = -1;\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2017-07-19T13:07:29.000+0000", "updated": "2017-07-19T15:54:40.000+0000" }, { "id": "425902", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/9276", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2017-08-04T09:16:22.000+0000", "updated": "2017-08-04T09:16:22.000+0000" }, { "id": "430571", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed; PR's merged.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-14T00:30:37.000+0000", "updated": "2017-11-14T00:30:37.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }