{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1092","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1092/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1092/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1092/events","html_url":"https://github.com/lhorie/mithril.js/issues/1092","id":158491687,"number":1092,"title":"unloadCachedControllers usage of noop overwrites $old","user":{"login":"leiyangyou","id":104397,"avatar_url":"https://avatars.githubusercontent.com/u/104397?v=3","gravatar_id":"","url":"https://api.github.com/users/leiyangyou","html_url":"https://github.com/leiyangyou","followers_url":"https://api.github.com/users/leiyangyou/followers","following_url":"https://api.github.com/users/leiyangyou/following{/other_user}","gists_url":"https://api.github.com/users/leiyangyou/gists{/gist_id}","starred_url":"https://api.github.com/users/leiyangyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leiyangyou/subscriptions","organizations_url":"https://api.github.com/users/leiyangyou/orgs","repos_url":"https://api.github.com/users/leiyangyou/repos","events_url":"https://api.github.com/users/leiyangyou/events{/privacy}","received_events_url":"https://api.github.com/users/leiyangyou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lhorie/mithril.js/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/lhorie/mithril.js/labels/contribution%20welcome","name":"contribution welcome","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-04T07:00:11Z","updated_at":"2016-09-25T23:13:28Z","closed_at":null,"body":"found a bug where the wrong onunload has been assigned to controllers, we tracked it down to the following lines\r\n```javascript\r\nfunction unloadCachedControllers(cached, views, controllers) {\r\n\t\tif (controllers.length) {\r\n\t\t\tcached.views = views\r\n\t\t\tcached.controllers = controllers\r\n\t\t\tforEach(controllers, function (controller) {\r\n\t\t\t\tif (controller.onunload && controller.onunload.$old) {\r\n\t\t\t\t\tcontroller.onunload = controller.onunload.$old\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (pendingRequests && controller.onunload) {\r\n\t\t\t\t\tvar onunload = controller.onunload\r\n\t\t\t\t\tcontroller.onunload = noop\r\n\t\t\t\t\tcontroller.onunload.$old = onunload\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n```\r\n$old on noop gets overwritten when multiple controllers are involved"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/249452791","html_url":"https://github.com/lhorie/mithril.js/issues/1092#issuecomment-249452791","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1092","id":249452791,"user":{"login":"Morklympious","id":5068257,"avatar_url":"https://avatars.githubusercontent.com/u/5068257?v=3","gravatar_id":"","url":"https://api.github.com/users/Morklympious","html_url":"https://github.com/Morklympious","followers_url":"https://api.github.com/users/Morklympious/followers","following_url":"https://api.github.com/users/Morklympious/following{/other_user}","gists_url":"https://api.github.com/users/Morklympious/gists{/gist_id}","starred_url":"https://api.github.com/users/Morklympious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morklympious/subscriptions","organizations_url":"https://api.github.com/users/Morklympious/orgs","repos_url":"https://api.github.com/users/Morklympious/repos","events_url":"https://api.github.com/users/Morklympious/events{/privacy}","received_events_url":"https://api.github.com/users/Morklympious/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T23:13:28Z","updated_at":"2016-09-25T23:13:28Z","body":"We can close this now, yeh?"}}
{"actor":{"display_login":"Morklympious"}}