{"action":"created","comment":{"url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/comments/43647851","id":43647851,"diff_hunk":"@@ -17,10 +19,12 @@ Library::Library(stringw name, unsigned int buffer_size)\n \n     for (unsigned int i = 0; i < file_list->getFileCount(); i++)\n     {\n-        IXMLReader* xml_reader = file_system->createXMLReader(\n-            file_list->getFullFileName(i));\n+        AutoDrop<IXMLReader> xml_reader(file_system->createXMLReader(\n+            file_list->getFullFileName(i)));\n+\n+        // Make sure we don't leak element.\n+        std::auto_ptr<Element> element(new Element(xml_reader.get()));","path":"src/gui/library.cpp","position":20,"original_position":20,"commit_id":"57801943580280d73a1713af27deb0482bbe893b","original_commit_id":"57801943580280d73a1713af27deb0482bbe893b","user":{"login":"CruzR","id":679188,"avatar_url":"https://avatars.githubusercontent.com/u/679188?v=3","gravatar_id":"","url":"https://api.github.com/users/CruzR","html_url":"https://github.com/CruzR","followers_url":"https://api.github.com/users/CruzR/followers","following_url":"https://api.github.com/users/CruzR/following{/other_user}","gists_url":"https://api.github.com/users/CruzR/gists{/gist_id}","starred_url":"https://api.github.com/users/CruzR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruzR/subscriptions","organizations_url":"https://api.github.com/users/CruzR/orgs","repos_url":"https://api.github.com/users/CruzR/repos","events_url":"https://api.github.com/users/CruzR/events{/privacy}","received_events_url":"https://api.github.com/users/CruzR/received_events","type":"User","site_admin":false},"body":"Well yeah, it's deprecated as of C++11, but I thought you were restricting yourself to C++03, where it's the only smart pointer in the standard library. If that information is outdated as you said, then there's indeed no reason to not use ``unique_ptr`` instead.","created_at":"2015-11-02T16:31:14Z","updated_at":"2015-11-02T16:31:14Z","html_url":"https://github.com/supertuxkart/stk-editor/pull/4#discussion_r43647851","pull_request_url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/comments/43647851"},"html":{"href":"https://github.com/supertuxkart/stk-editor/pull/4#discussion_r43647851"},"pull_request":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4","id":49210976,"html_url":"https://github.com/supertuxkart/stk-editor/pull/4","diff_url":"https://github.com/supertuxkart/stk-editor/pull/4.diff","patch_url":"https://github.com/supertuxkart/stk-editor/pull/4.patch","issue_url":"https://api.github.com/repos/supertuxkart/stk-editor/issues/4","number":4,"state":"open","locked":false,"title":"Fix a couple of memory and resource leaks.","user":{"login":"CruzR","id":679188,"avatar_url":"https://avatars.githubusercontent.com/u/679188?v=3","gravatar_id":"","url":"https://api.github.com/users/CruzR","html_url":"https://github.com/CruzR","followers_url":"https://api.github.com/users/CruzR/followers","following_url":"https://api.github.com/users/CruzR/following{/other_user}","gists_url":"https://api.github.com/users/CruzR/gists{/gist_id}","starred_url":"https://api.github.com/users/CruzR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruzR/subscriptions","organizations_url":"https://api.github.com/users/CruzR/orgs","repos_url":"https://api.github.com/users/CruzR/repos","events_url":"https://api.github.com/users/CruzR/events{/privacy}","received_events_url":"https://api.github.com/users/CruzR/received_events","type":"User","site_admin":false},"body":" - Some local variables were allocated with new but never deleted.\r\n   They now use std::auto_ptr to prevent that from happening again.\r\n   std::unique_ptr would allow us to get rid of even more explicit\r\n   deletes, but the style guide for supertuxkart forbids using C++11\r\n   features.\r\n - Some irr::IReferenceCounted objects were not released with drop().\r\n   A new template class, AutoDrop, which works the same way as\r\n   std::auto_ptr, takes care of them.","created_at":"2015-10-29T22:49:37Z","updated_at":"2015-11-02T16:31:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59a9d2573b1898056cabf43fc5b45f0c9ce86689","assignee":{"login":"leyyin","id":1269608,"avatar_url":"https://avatars.githubusercontent.com/u/1269608?v=3","gravatar_id":"","url":"https://api.github.com/users/leyyin","html_url":"https://github.com/leyyin","followers_url":"https://api.github.com/users/leyyin/followers","following_url":"https://api.github.com/users/leyyin/following{/other_user}","gists_url":"https://api.github.com/users/leyyin/gists{/gist_id}","starred_url":"https://api.github.com/users/leyyin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leyyin/subscriptions","organizations_url":"https://api.github.com/users/leyyin/orgs","repos_url":"https://api.github.com/users/leyyin/repos","events_url":"https://api.github.com/users/leyyin/events{/privacy}","received_events_url":"https://api.github.com/users/leyyin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4/commits","review_comments_url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4/comments","review_comment_url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/supertuxkart/stk-editor/issues/4/comments","statuses_url":"https://api.github.com/repos/supertuxkart/stk-editor/statuses/57801943580280d73a1713af27deb0482bbe893b","head":{"label":"CruzR:memory-leaks","ref":"memory-leaks","sha":"57801943580280d73a1713af27deb0482bbe893b","user":{"login":"CruzR","id":679188,"avatar_url":"https://avatars.githubusercontent.com/u/679188?v=3","gravatar_id":"","url":"https://api.github.com/users/CruzR","html_url":"https://github.com/CruzR","followers_url":"https://api.github.com/users/CruzR/followers","following_url":"https://api.github.com/users/CruzR/following{/other_user}","gists_url":"https://api.github.com/users/CruzR/gists{/gist_id}","starred_url":"https://api.github.com/users/CruzR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruzR/subscriptions","organizations_url":"https://api.github.com/users/CruzR/orgs","repos_url":"https://api.github.com/users/CruzR/repos","events_url":"https://api.github.com/users/CruzR/events{/privacy}","received_events_url":"https://api.github.com/users/CruzR/received_events","type":"User","site_admin":false},"repo":{"id":45215200,"name":"stk-editor","full_name":"CruzR/stk-editor","owner":{"login":"CruzR","id":679188,"avatar_url":"https://avatars.githubusercontent.com/u/679188?v=3","gravatar_id":"","url":"https://api.github.com/users/CruzR","html_url":"https://github.com/CruzR","followers_url":"https://api.github.com/users/CruzR/followers","following_url":"https://api.github.com/users/CruzR/following{/other_user}","gists_url":"https://api.github.com/users/CruzR/gists{/gist_id}","starred_url":"https://api.github.com/users/CruzR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruzR/subscriptions","organizations_url":"https://api.github.com/users/CruzR/orgs","repos_url":"https://api.github.com/users/CruzR/repos","events_url":"https://api.github.com/users/CruzR/events{/privacy}","received_events_url":"https://api.github.com/users/CruzR/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CruzR/stk-editor","description":"SuperTuxKart - Track Editor","fork":true,"url":"https://api.github.com/repos/CruzR/stk-editor","forks_url":"https://api.github.com/repos/CruzR/stk-editor/forks","keys_url":"https://api.github.com/repos/CruzR/stk-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CruzR/stk-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CruzR/stk-editor/teams","hooks_url":"https://api.github.com/repos/CruzR/stk-editor/hooks","issue_events_url":"https://api.github.com/repos/CruzR/stk-editor/issues/events{/number}","events_url":"https://api.github.com/repos/CruzR/stk-editor/events","assignees_url":"https://api.github.com/repos/CruzR/stk-editor/assignees{/user}","branches_url":"https://api.github.com/repos/CruzR/stk-editor/branches{/branch}","tags_url":"https://api.github.com/repos/CruzR/stk-editor/tags","blobs_url":"https://api.github.com/repos/CruzR/stk-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CruzR/stk-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CruzR/stk-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/CruzR/stk-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CruzR/stk-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/CruzR/stk-editor/languages","stargazers_url":"https://api.github.com/repos/CruzR/stk-editor/stargazers","contributors_url":"https://api.github.com/repos/CruzR/stk-editor/contributors","subscribers_url":"https://api.github.com/repos/CruzR/stk-editor/subscribers","subscription_url":"https://api.github.com/repos/CruzR/stk-editor/subscription","commits_url":"https://api.github.com/repos/CruzR/stk-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/CruzR/stk-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/CruzR/stk-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/CruzR/stk-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/CruzR/stk-editor/contents/{+path}","compare_url":"https://api.github.com/repos/CruzR/stk-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CruzR/stk-editor/merges","archive_url":"https://api.github.com/repos/CruzR/stk-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CruzR/stk-editor/downloads","issues_url":"https://api.github.com/repos/CruzR/stk-editor/issues{/number}","pulls_url":"https://api.github.com/repos/CruzR/stk-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/CruzR/stk-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/CruzR/stk-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CruzR/stk-editor/labels{/name}","releases_url":"https://api.github.com/repos/CruzR/stk-editor/releases{/id}","created_at":"2015-10-29T22:46:31Z","updated_at":"2015-10-29T22:46:38Z","pushed_at":"2015-10-29T22:47:46Z","git_url":"git://github.com/CruzR/stk-editor.git","ssh_url":"git@github.com:CruzR/stk-editor.git","clone_url":"https://github.com/CruzR/stk-editor.git","svn_url":"https://github.com/CruzR/stk-editor","homepage":null,"size":14629,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"supertuxkart:master","ref":"master","sha":"8fecd7bfe018347e27f12e39cc377112cf71da63","user":{"login":"supertuxkart","id":6138677,"avatar_url":"https://avatars.githubusercontent.com/u/6138677?v=3","gravatar_id":"","url":"https://api.github.com/users/supertuxkart","html_url":"https://github.com/supertuxkart","followers_url":"https://api.github.com/users/supertuxkart/followers","following_url":"https://api.github.com/users/supertuxkart/following{/other_user}","gists_url":"https://api.github.com/users/supertuxkart/gists{/gist_id}","starred_url":"https://api.github.com/users/supertuxkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertuxkart/subscriptions","organizations_url":"https://api.github.com/users/supertuxkart/orgs","repos_url":"https://api.github.com/users/supertuxkart/repos","events_url":"https://api.github.com/users/supertuxkart/events{/privacy}","received_events_url":"https://api.github.com/users/supertuxkart/received_events","type":"Organization","site_admin":false},"repo":{"id":30349902,"name":"stk-editor","full_name":"supertuxkart/stk-editor","owner":{"login":"supertuxkart","id":6138677,"avatar_url":"https://avatars.githubusercontent.com/u/6138677?v=3","gravatar_id":"","url":"https://api.github.com/users/supertuxkart","html_url":"https://github.com/supertuxkart","followers_url":"https://api.github.com/users/supertuxkart/followers","following_url":"https://api.github.com/users/supertuxkart/following{/other_user}","gists_url":"https://api.github.com/users/supertuxkart/gists{/gist_id}","starred_url":"https://api.github.com/users/supertuxkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertuxkart/subscriptions","organizations_url":"https://api.github.com/users/supertuxkart/orgs","repos_url":"https://api.github.com/users/supertuxkart/repos","events_url":"https://api.github.com/users/supertuxkart/events{/privacy}","received_events_url":"https://api.github.com/users/supertuxkart/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/supertuxkart/stk-editor","description":"SuperTuxKart - Track Editor","fork":false,"url":"https://api.github.com/repos/supertuxkart/stk-editor","forks_url":"https://api.github.com/repos/supertuxkart/stk-editor/forks","keys_url":"https://api.github.com/repos/supertuxkart/stk-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supertuxkart/stk-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supertuxkart/stk-editor/teams","hooks_url":"https://api.github.com/repos/supertuxkart/stk-editor/hooks","issue_events_url":"https://api.github.com/repos/supertuxkart/stk-editor/issues/events{/number}","events_url":"https://api.github.com/repos/supertuxkart/stk-editor/events","assignees_url":"https://api.github.com/repos/supertuxkart/stk-editor/assignees{/user}","branches_url":"https://api.github.com/repos/supertuxkart/stk-editor/branches{/branch}","tags_url":"https://api.github.com/repos/supertuxkart/stk-editor/tags","blobs_url":"https://api.github.com/repos/supertuxkart/stk-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supertuxkart/stk-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supertuxkart/stk-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/supertuxkart/stk-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supertuxkart/stk-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/supertuxkart/stk-editor/languages","stargazers_url":"https://api.github.com/repos/supertuxkart/stk-editor/stargazers","contributors_url":"https://api.github.com/repos/supertuxkart/stk-editor/contributors","subscribers_url":"https://api.github.com/repos/supertuxkart/stk-editor/subscribers","subscription_url":"https://api.github.com/repos/supertuxkart/stk-editor/subscription","commits_url":"https://api.github.com/repos/supertuxkart/stk-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/supertuxkart/stk-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/supertuxkart/stk-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/supertuxkart/stk-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/supertuxkart/stk-editor/contents/{+path}","compare_url":"https://api.github.com/repos/supertuxkart/stk-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supertuxkart/stk-editor/merges","archive_url":"https://api.github.com/repos/supertuxkart/stk-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supertuxkart/stk-editor/downloads","issues_url":"https://api.github.com/repos/supertuxkart/stk-editor/issues{/number}","pulls_url":"https://api.github.com/repos/supertuxkart/stk-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/supertuxkart/stk-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/supertuxkart/stk-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supertuxkart/stk-editor/labels{/name}","releases_url":"https://api.github.com/repos/supertuxkart/stk-editor/releases{/id}","created_at":"2015-02-05T10:25:36Z","updated_at":"2015-08-11T02:02:40Z","pushed_at":"2015-10-29T22:49:37Z","git_url":"git://github.com/supertuxkart/stk-editor.git","ssh_url":"git@github.com:supertuxkart/stk-editor.git","clone_url":"https://github.com/supertuxkart/stk-editor.git","svn_url":"https://github.com/supertuxkart/stk-editor","homepage":null,"size":15154,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4"},"html":{"href":"https://github.com/supertuxkart/stk-editor/pull/4"},"issue":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/issues/4"},"comments":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/supertuxkart/stk-editor/statuses/57801943580280d73a1713af27deb0482bbe893b"}}}}