{ "id": "106782", "key": "ALOY-432", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14770", "description": "Alloy 0.3.4", "name": "Alloy 0.3.4", "archived": false, "released": true, "releaseDate": "2012-12-14" }, { "id": "14790", "description": "2012 Sprint 26", "name": "2012 Sprint 26", "archived": true, "released": true, "releaseDate": "2012-12-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-12-19T04:12:01.000+0000", "created": "2012-12-19T03:14:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "notable" ], "versions": [], "issuelinks": [ { "id": "23801", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "106897", "key": "TIDOC-953", "fields": { "summary": "Guides: document destroy() function on Alloy controllers", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "23775", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "97491", "key": "ALOY-103", "fields": { "summary": "Model-View binding for discrete components", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": null, "updated": "2018-03-07T22:25:47.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "*IMPORTANT*: Calling destroy() will be critical for preventing memory leaks in alloy code that employs model-view binding.\r\n\r\nWe will be adding a *destroy()* function to all controllers. Under the hood this will be added as:\r\n\r\n{code:javascript}\r\nexports.destroy = function() {\r\n // auto-generated destroy code\r\n}\r\n{code}\r\n\r\nIn its initial form, the destroy() function will be used only to remove event listeners tied to global and local references to models/collections, which are created when model-view binding is employed. A typical example of using it would be when you close a controller's window if it or any of its UI components used model-view binding.\r\n\r\n{code:javascript}\r\n$.win.on('close', function() {\r\n $.destroy(); // clean up binding\r\n});\r\n{code}\r\n\r\nThis will prevent any possible memory leaks, specifically when making bindings against a global model (Alloy.Models) or collection (Alloy.Collections).\r\n", "attachment": [], "flagged": false, "summary": "add destroy() function to all controllers", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "231975", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "All model and collection binding can now be cleaned, and made free of potential memory leaks, by calling destroy() on the controller. ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-19T04:12:01.000+0000", "updated": "2012-12-19T04:12:01.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }