{"action":"created","issue":{"url":"https://api.github.com/repos/Corvusoft/restbed/issues/85","repository_url":"https://api.github.com/repos/Corvusoft/restbed","labels_url":"https://api.github.com/repos/Corvusoft/restbed/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/Corvusoft/restbed/issues/85/comments","events_url":"https://api.github.com/repos/Corvusoft/restbed/issues/85/events","html_url":"https://github.com/Corvusoft/restbed/issues/85","id":147028123,"number":85,"title":"Session objects leak permanently","user":{"login":"willmmiles","id":6540455,"avatar_url":"https://avatars.githubusercontent.com/u/6540455?v=3","gravatar_id":"","url":"https://api.github.com/users/willmmiles","html_url":"https://github.com/willmmiles","followers_url":"https://api.github.com/users/willmmiles/followers","following_url":"https://api.github.com/users/willmmiles/following{/other_user}","gists_url":"https://api.github.com/users/willmmiles/gists{/gist_id}","starred_url":"https://api.github.com/users/willmmiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmmiles/subscriptions","organizations_url":"https://api.github.com/users/willmmiles/orgs","repos_url":"https://api.github.com/users/willmmiles/repos","events_url":"https://api.github.com/users/willmmiles/events{/privacy}","received_events_url":"https://api.github.com/users/willmmiles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Corvusoft/restbed/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"callum-kirby","id":17439359,"avatar_url":"https://avatars.githubusercontent.com/u/17439359?v=3","gravatar_id":"","url":"https://api.github.com/users/callum-kirby","html_url":"https://github.com/callum-kirby","followers_url":"https://api.github.com/users/callum-kirby/followers","following_url":"https://api.github.com/users/callum-kirby/following{/other_user}","gists_url":"https://api.github.com/users/callum-kirby/gists{/gist_id}","starred_url":"https://api.github.com/users/callum-kirby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callum-kirby/subscriptions","organizations_url":"https://api.github.com/users/callum-kirby/orgs","repos_url":"https://api.github.com/users/callum-kirby/repos","events_url":"https://api.github.com/users/callum-kirby/events{/privacy}","received_events_url":"https://api.github.com/users/callum-kirby/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Corvusoft/restbed/milestones/3","html_url":"https://github.com/Corvusoft/restbed/milestones/4.0","labels_url":"https://api.github.com/repos/Corvusoft/restbed/milestones/3/labels","id":1319843,"number":3,"title":"4.0","description":"","creator":{"login":"ben-crowhurst","id":3715287,"avatar_url":"https://avatars.githubusercontent.com/u/3715287?v=3","gravatar_id":"","url":"https://api.github.com/users/ben-crowhurst","html_url":"https://github.com/ben-crowhurst","followers_url":"https://api.github.com/users/ben-crowhurst/followers","following_url":"https://api.github.com/users/ben-crowhurst/following{/other_user}","gists_url":"https://api.github.com/users/ben-crowhurst/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-crowhurst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-crowhurst/subscriptions","organizations_url":"https://api.github.com/users/ben-crowhurst/orgs","repos_url":"https://api.github.com/users/ben-crowhurst/repos","events_url":"https://api.github.com/users/ben-crowhurst/events{/privacy}","received_events_url":"https://api.github.com/users/ben-crowhurst/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":23,"state":"open","created_at":"2015-09-23T07:22:16Z","updated_at":"2016-04-09T22:04:40Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-04-08T20:13:42Z","updated_at":"2016-04-11T14:18:12Z","closed_at":null,"body":"Hi,\r\n\r\nI was tracking a memory leak issue in my application, and I found what appears to be a self-reference problem with Session objects.   When a Session is created by the Service, the bind calls at source/corvusoft/restbed/detail/service_impl.cpp:295 or :522 store a shared_ptr to the Session inside one of the Session's own members.  This means that the Session's shared_ptr's use_count will always be >=1 -- essentially the Session is pointing to itself -- and thus the Session will be leaked and never destructed.   It looks like this bug was introduced by commit dedc9a4.\r\n\r\nGiven that it looks like there's a refactor in progress, it wasn't immediately apparent what the best way to solve this was.   Any guidance on how best to fix this would be appreciated.\r\n\r\nThanks,\r\n\r\nWill"},"comment":{"url":"https://api.github.com/repos/Corvusoft/restbed/issues/comments/208369086","html_url":"https://github.com/Corvusoft/restbed/issues/85#issuecomment-208369086","issue_url":"https://api.github.com/repos/Corvusoft/restbed/issues/85","id":208369086,"user":{"login":"willmmiles","id":6540455,"avatar_url":"https://avatars.githubusercontent.com/u/6540455?v=3","gravatar_id":"","url":"https://api.github.com/users/willmmiles","html_url":"https://github.com/willmmiles","followers_url":"https://api.github.com/users/willmmiles/followers","following_url":"https://api.github.com/users/willmmiles/following{/other_user}","gists_url":"https://api.github.com/users/willmmiles/gists{/gist_id}","starred_url":"https://api.github.com/users/willmmiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmmiles/subscriptions","organizations_url":"https://api.github.com/users/willmmiles/orgs","repos_url":"https://api.github.com/users/willmmiles/repos","events_url":"https://api.github.com/users/willmmiles/events{/privacy}","received_events_url":"https://api.github.com/users/willmmiles/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T14:18:12Z","updated_at":"2016-04-11T14:18:12Z","body":"Yes, I can confirm that this patch does fix the issue.   Thank you very much!"}}