{"action":"created","issue":{"url":"https://api.github.com/repos/lazywei/go-opencv/issues/83","repository_url":"https://api.github.com/repos/lazywei/go-opencv","labels_url":"https://api.github.com/repos/lazywei/go-opencv/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/lazywei/go-opencv/issues/83/comments","events_url":"https://api.github.com/repos/lazywei/go-opencv/issues/83/events","html_url":"https://github.com/lazywei/go-opencv/issues/83","id":178223021,"number":83,"title":"Memory leak","user":{"login":"fredcarle","id":4949751,"avatar_url":"https://avatars.githubusercontent.com/u/4949751?v=3","gravatar_id":"","url":"https://api.github.com/users/fredcarle","html_url":"https://github.com/fredcarle","followers_url":"https://api.github.com/users/fredcarle/followers","following_url":"https://api.github.com/users/fredcarle/following{/other_user}","gists_url":"https://api.github.com/users/fredcarle/gists{/gist_id}","starred_url":"https://api.github.com/users/fredcarle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredcarle/subscriptions","organizations_url":"https://api.github.com/users/fredcarle/orgs","repos_url":"https://api.github.com/users/fredcarle/repos","events_url":"https://api.github.com/users/fredcarle/events{/privacy}","received_events_url":"https://api.github.com/users/fredcarle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-21T01:34:24Z","updated_at":"2016-09-23T19:16:29Z","closed_at":"2016-09-23T19:16:29Z","body":"I tried to reproduce a C++ code that did motion detection using this package and I have a memory leak that I can't seem to find the source of. I'm not sure if it's from my code or from one of the bindings. Can someone look at my code and help me out with this? If it's not my code, maybe this will help find the possible source in the binding code.\r\n\r\nhttps://gist.github.com/fredcarle/2b73b82ed2657b297824fe55caf94b52#file-motiondetect-go"},"comment":{"url":"https://api.github.com/repos/lazywei/go-opencv/issues/comments/249279277","html_url":"https://github.com/lazywei/go-opencv/issues/83#issuecomment-249279277","issue_url":"https://api.github.com/repos/lazywei/go-opencv/issues/83","id":249279277,"user":{"login":"kevinabrandon","id":13565386,"avatar_url":"https://avatars.githubusercontent.com/u/13565386?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinabrandon","html_url":"https://github.com/kevinabrandon","followers_url":"https://api.github.com/users/kevinabrandon/followers","following_url":"https://api.github.com/users/kevinabrandon/following{/other_user}","gists_url":"https://api.github.com/users/kevinabrandon/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinabrandon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinabrandon/subscriptions","organizations_url":"https://api.github.com/users/kevinabrandon/orgs","repos_url":"https://api.github.com/users/kevinabrandon/repos","events_url":"https://api.github.com/users/kevinabrandon/events{/privacy}","received_events_url":"https://api.github.com/users/kevinabrandon/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T19:16:29Z","updated_at":"2016-09-23T19:16:29Z","body":"It was indeed leaking and I found the source (hopefully it's the only one).\r\n\r\nIn detectMotion() you get the result's width and height by doing result.GetMat().Cols() and then result.GetMat().Rows().  Each time you do that you are creating a new Mat with the GetMat().  A full copy is made and is never released.\r\n\r\nInstead you should simply do result.Width() and result.Height(), which isn't creating anything new.\r\n"}}
{"actor":{"display_login":"kevinabrandon"}}