{"action":"opened","issue":{"url":"https://api.github.com/repos/alexanderBaranov/OOP/issues/11","labels_url":"https://api.github.com/repos/alexanderBaranov/OOP/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/alexanderBaranov/OOP/issues/11/comments","events_url":"https://api.github.com/repos/alexanderBaranov/OOP/issues/11/events","html_url":"https://github.com/alexanderBaranov/OOP/issues/11","id":117754973,"number":11,"title":"Замечания по программе People","user":{"login":"alexey-malov","id":6040682,"avatar_url":"https://avatars.githubusercontent.com/u/6040682?v=3","gravatar_id":"","url":"https://api.github.com/users/alexey-malov","html_url":"https://github.com/alexey-malov","followers_url":"https://api.github.com/users/alexey-malov/followers","following_url":"https://api.github.com/users/alexey-malov/following{/other_user}","gists_url":"https://api.github.com/users/alexey-malov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexey-malov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexey-malov/subscriptions","organizations_url":"https://api.github.com/users/alexey-malov/orgs","repos_url":"https://api.github.com/users/alexey-malov/repos","events_url":"https://api.github.com/users/alexey-malov/events{/privacy}","received_events_url":"https://api.github.com/users/alexey-malov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-19T07:03:54Z","updated_at":"2015-11-19T07:03:54Z","closed_at":null,"body":"Следующий код вызывает утечку памяти:\r\n\r\n```c++\r\n\tauto university = make_shared<CUniversity>(\"MIT\");\r\n\t// Если закомментировать следующую строчку, то утечки не будет\r\n\tunique_ptr<CPerson> p = make_unique<CStudent>(\"Ivan\", \"male\", 180, 80, 20, university, 1);\r\n\r\n\t// Утечки памяти не будет, и если строчку переписать следующим образом\r\n\t// auto p = make_unique<CStudent>(\"Ivan\", \"male\", 180, 80, 20, university, 1);\r\n\t// или так:\r\n\t// shared_ptr<CPerson> p = make_unique<CStudent>(\"Ivan\", \"male\", 180, 80, 20, university, 1);\r\n\t// или так:\r\n\t// shared_ptr<CPerson> p = make_shared<CStudent>(\"Ivan\", \"male\", 180, 80, 20, university, 1);\r\n\t// или так:\r\n\t// shared_ptr<CPerson> p(new CStudent(\"Ivan\", \"male\", 180, 80, 20, university, 1));\r\n\r\n\r\n```\r\nvisual leak detector можно скачать с сайта vld.codeplex.com\r\nлибо убедиться в ее наличии, добавив в деструктор CUniversity какой-нибудь вывод в output."}}