{"action":"created","issue":{"url":"https://api.github.com/repos/apitrace/apitrace/issues/345","labels_url":"https://api.github.com/repos/apitrace/apitrace/issues/345/labels{/name}","comments_url":"https://api.github.com/repos/apitrace/apitrace/issues/345/comments","events_url":"https://api.github.com/repos/apitrace/apitrace/issues/345/events","html_url":"https://github.com/apitrace/apitrace/issues/345","id":85147906,"number":345,"title":"Qapitrace leaks when saving traces","user":{"login":"jlegg0","id":6033562,"avatar_url":"https://avatars.githubusercontent.com/u/6033562?v=3","gravatar_id":"","url":"https://api.github.com/users/jlegg0","html_url":"https://github.com/jlegg0","followers_url":"https://api.github.com/users/jlegg0/followers","following_url":"https://api.github.com/users/jlegg0/following{/other_user}","gists_url":"https://api.github.com/users/jlegg0/gists{/gist_id}","starred_url":"https://api.github.com/users/jlegg0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlegg0/subscriptions","organizations_url":"https://api.github.com/users/jlegg0/orgs","repos_url":"https://api.github.com/users/jlegg0/repos","events_url":"https://api.github.com/users/jlegg0/events{/privacy}","received_events_url":"https://api.github.com/users/jlegg0/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-04T15:30:13Z","updated_at":"2015-06-05T20:36:44Z","closed_at":"2015-06-05T20:35:57Z","body":"When editing a trace in qapitrace, the modified trace is saved to a file. This leaks memory. On very large traces, this tends to be enough cause the kernel out of memory killer to kill qapitrace before it completes. \r\n\r\nThe following patch fixes the problem (I haven't checked if no memory is leaked after applying it, but editing large traces no longer causes an obvious permanent increase).\r\n```patch\r\ndiff --git a/gui/saverthread.cpp b/gui/saverthread.cpp\r\nindex 990aeee..e9e5a3f 100644\r\n--- a/gui/saverthread.cpp\r\n+++ b/gui/saverthread.cpp\r\n@@ -374,6 +374,7 @@ void SaverThread::run()\r\n         } else {\r\n             writer.writeCall(call);\r\n         }\r\n+        delete call;\r\n     }\r\n \r\n     writer.close();\r\n```"},"comment":{"url":"https://api.github.com/repos/apitrace/apitrace/issues/comments/109432712","html_url":"https://github.com/apitrace/apitrace/issues/345#issuecomment-109432712","issue_url":"https://api.github.com/repos/apitrace/apitrace/issues/345","id":109432712,"user":{"login":"jrfonseca","id":140183,"avatar_url":"https://avatars.githubusercontent.com/u/140183?v=3","gravatar_id":"","url":"https://api.github.com/users/jrfonseca","html_url":"https://github.com/jrfonseca","followers_url":"https://api.github.com/users/jrfonseca/followers","following_url":"https://api.github.com/users/jrfonseca/following{/other_user}","gists_url":"https://api.github.com/users/jrfonseca/gists{/gist_id}","starred_url":"https://api.github.com/users/jrfonseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrfonseca/subscriptions","organizations_url":"https://api.github.com/users/jrfonseca/orgs","repos_url":"https://api.github.com/users/jrfonseca/repos","events_url":"https://api.github.com/users/jrfonseca/events{/privacy}","received_events_url":"https://api.github.com/users/jrfonseca/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T20:36:44Z","updated_at":"2015-06-05T20:36:44Z","body":"Good catch. Thanks.\r\n\r\nOne day I should invest in automated testing of the GUI so we can catch this sort of things."}}