{"action":"closed","issue":{"url":"https://api.github.com/repos/Rapptz/discord.py/issues/405","repository_url":"https://api.github.com/repos/Rapptz/discord.py","labels_url":"https://api.github.com/repos/Rapptz/discord.py/issues/405/labels{/name}","comments_url":"https://api.github.com/repos/Rapptz/discord.py/issues/405/comments","events_url":"https://api.github.com/repos/Rapptz/discord.py/issues/405/events","html_url":"https://github.com/Rapptz/discord.py/issues/405","id":192049299,"number":405,"title":"Allow extensions to do cleanup when being unloaded","user":{"login":"ButterCheezii","id":22616762,"avatar_url":"https://avatars.githubusercontent.com/u/22616762?v=3","gravatar_id":"","url":"https://api.github.com/users/ButterCheezii","html_url":"https://github.com/ButterCheezii","followers_url":"https://api.github.com/users/ButterCheezii/followers","following_url":"https://api.github.com/users/ButterCheezii/following{/other_user}","gists_url":"https://api.github.com/users/ButterCheezii/gists{/gist_id}","starred_url":"https://api.github.com/users/ButterCheezii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ButterCheezii/subscriptions","organizations_url":"https://api.github.com/users/ButterCheezii/orgs","repos_url":"https://api.github.com/users/ButterCheezii/repos","events_url":"https://api.github.com/users/ButterCheezii/events{/privacy}","received_events_url":"https://api.github.com/users/ButterCheezii/received_events","type":"User","site_admin":false},"labels":[{"id":251130943,"url":"https://api.github.com/repos/Rapptz/discord.py/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-11-28T16:21:30Z","updated_at":"2016-12-17T19:16:23Z","closed_at":"2016-12-17T19:16:23Z","body":"In an extension, when working with threads they will stay running when `unload_extension` is called.\r\n\r\nI want you to allow the extension to have an `unload()` function that is called before unloading the extension, so we can have a chance to clean up any open file handlers, stop threads, etc."}}
{"actor":{"display_login":"Rapptz"}}