{"action":"created","comment":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/45192648","id":45192648,"diff_hunk":"@@ -34,7 +34,10 @@ SvgPlot: class {\n \t\tthis datasets free()\n \t\tthis xAxis free()\n \t\tthis yAxis free()\n-\t\tthis colorList free()\n+\t\tif (this colorList) {\n+\t\t\tthis colorList _count = 0","path":"source/plot/SvgPlot.ooc","position":6,"original_position":6,"commit_id":"e75528b0a1b99bbb4262aacee6020a15bfe8e41d","original_commit_id":"e75528b0a1b99bbb4262aacee6020a15bfe8e41d","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"body":"`colorList` entries are shared (as in the PR description), this is a way around that which allows to free the `colorList` anyway.","created_at":"2015-11-18T12:25:34Z","updated_at":"2015-11-18T12:25:34Z","html_url":"https://github.com/cogneco/ooc-kean/pull/824#discussion_r45192648","pull_request_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824","_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/45192648"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/824#discussion_r45192648"},"pull_request":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824"}}},"pull_request":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824","id":51077599,"html_url":"https://github.com/cogneco/ooc-kean/pull/824","diff_url":"https://github.com/cogneco/ooc-kean/pull/824.diff","patch_url":"https://github.com/cogneco/ooc-kean/pull/824.patch","issue_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/824","number":824,"state":"open","locked":false,"title":"Fixed memory issues in Plot class","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/cogneco/ooc-kean/issues/819\r\n\r\nIt was even better than simple memory leaks. It was impossible to call `free` on `SvgWriter2D` if it had more than one plot data.\r\nTo be more specific, it was impossible to call `free` on two different instances of `SvgPlot` class. It crashed because of double delete/free. Reason for this was the `colorList` variable, filled here:\r\n```ooc\r\n\tfillColorList: func {\r\n\t\tthis colorList = VectorList<String> new()\r\n\t\tthis colorList add(\"crimson\")\r\n\t\tthis colorList add(\"black\")\r\n\t\tthis colorList add(\"darkmagenta\")\r\n\t\tthis colorList add(\"seagreen\")\r\n\t\tthis colorList add(\"dodgerblue\")\r\n\t\tthis colorList add(\"darkorange\")\r\n\t\tthis colorList add(\"hotpink\")\r\n\t\tthis colorList add(\"lightgreen\")\r\n\t\tthis colorList add(\"yellowgreen\")\r\n\t\tthis colorList add(\"red\")\r\n\t}\r\n```\r\nEach of the color entries was compiled into executable as string literal, so in the end every `colorList` in each `SvgPlot` pointed to the same data:\r\n```C\r\n        __SvgPlot_strLit20 = (void*) lang_String__makeStringLiteral(\"yellowgreen\", 11);\r\n        __SvgPlot_strLit19 = (void*) lang_String__makeStringLiteral(\"lightgreen\", 10);\r\n        __SvgPlot_strLit18 = (void*) lang_String__makeStringLiteral(\"hotpink\", 7);\r\n        __SvgPlot_strLit17 = (void*) lang_String__makeStringLiteral(\"darkorange\", 10);\r\n        __SvgPlot_strLit16 = (void*) lang_String__makeStringLiteral(\"dodgerblue\", 10);\r\n        __SvgPlot_strLit15 = (void*) lang_String__makeStringLiteral(\"seagreen\", 8);\r\n        __SvgPlot_strLit14 = (void*) lang_String__makeStringLiteral(\"darkmagenta\", 11);\r\n        __SvgPlot_strLit13 = (void*) lang_String__makeStringLiteral(\"black\", 5);\r\n        __SvgPlot_strLit12 = (void*) lang_String__makeStringLiteral(\"crimson\", 7);\r\n\r\n...\r\nvoid SvgPlot__SvgPlot_fillColorList(SvgPlot__SvgPlot* this) {\r\n    SvgPlot__SvgPlot___setcolorList__(this, VectorList__VectorList_new_default((lang_types__Class*)lang_String__String_class()));\r\n    VectorList__VectorList_add(SvgPlot__SvgPlot___getcolorList__(this), (uint8_t*) &(__SvgPlot_strLit12));\r\n    VectorList__VectorList_add(SvgPlot__SvgPlot___getcolorList__(this), (uint8_t*) &(__SvgPlot_strLit13));\r\n...\r\n```\r\nThis PR fixes these memory issues and some memory leaks.","created_at":"2015-11-18T12:23:52Z","updated_at":"2015-11-18T12:25:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d852ce2b9018dd4cab387baf8768c6b79e049d4d","assignee":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cogneco/ooc-kean/milestones/4","html_url":"https://github.com/cogneco/ooc-kean/milestones/Cleanup","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/milestones/4/labels","id":1377591,"number":4,"title":"Cleanup","description":"Trivial, non-urgent cleanup &mdash; unused functions, classes, and such.","creator":{"login":"davidhesselbom","id":4319680,"avatar_url":"https://avatars.githubusercontent.com/u/4319680?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhesselbom","html_url":"https://github.com/davidhesselbom","followers_url":"https://api.github.com/users/davidhesselbom/followers","following_url":"https://api.github.com/users/davidhesselbom/following{/other_user}","gists_url":"https://api.github.com/users/davidhesselbom/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhesselbom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhesselbom/subscriptions","organizations_url":"https://api.github.com/users/davidhesselbom/orgs","repos_url":"https://api.github.com/users/davidhesselbom/repos","events_url":"https://api.github.com/users/davidhesselbom/events{/privacy}","received_events_url":"https://api.github.com/users/davidhesselbom/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":18,"state":"open","created_at":"2015-10-26T16:34:28Z","updated_at":"2015-11-18T12:23:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824/commits","review_comments_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824/comments","review_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/824/comments","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/e75528b0a1b99bbb4262aacee6020a15bfe8e41d","head":{"label":"sebastianbaginski:cleanup_plotleaks","ref":"cleanup_plotleaks","sha":"e75528b0a1b99bbb4262aacee6020a15bfe8e41d","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"repo":{"id":39762712,"name":"ooc-kean","full_name":"sebastianbaginski/ooc-kean","owner":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebastianbaginski/ooc-kean","description":"ooc port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/sebastianbaginski/ooc-kean","forks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/forks","keys_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/teams","hooks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/events","assignees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/tags","blobs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscription","commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/merges","archive_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/downloads","issues_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/releases{/id}","created_at":"2015-07-27T08:08:08Z","updated_at":"2015-07-27T08:08:09Z","pushed_at":"2015-11-18T12:16:58Z","git_url":"git://github.com/sebastianbaginski/ooc-kean.git","ssh_url":"git@github.com:sebastianbaginski/ooc-kean.git","clone_url":"https://github.com/sebastianbaginski/ooc-kean.git","svn_url":"https://github.com/sebastianbaginski/ooc-kean","homepage":"","size":27389,"stargazers_count":0,"watchers_count":0,"language":"ooc","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":"cogneco:master","ref":"master","sha":"67852add34c6bf916341e99e5701745852d5ee9f","user":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"cogneco/ooc-kean","owner":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cogneco/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/cogneco/ooc-kean","forks_url":"https://api.github.com/repos/cogneco/ooc-kean/forks","keys_url":"https://api.github.com/repos/cogneco/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cogneco/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cogneco/ooc-kean/teams","hooks_url":"https://api.github.com/repos/cogneco/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/cogneco/ooc-kean/events","assignees_url":"https://api.github.com/repos/cogneco/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/cogneco/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/cogneco/ooc-kean/tags","blobs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cogneco/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/cogneco/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/cogneco/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/cogneco/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/cogneco/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/cogneco/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/cogneco/ooc-kean/subscription","commits_url":"https://api.github.com/repos/cogneco/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/cogneco/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/cogneco/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/cogneco/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cogneco/ooc-kean/merges","archive_url":"https://api.github.com/repos/cogneco/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cogneco/ooc-kean/downloads","issues_url":"https://api.github.com/repos/cogneco/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/cogneco/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/cogneco/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/cogneco/ooc-kean/releases{/id}","created_at":"2014-10-15T13:42:17Z","updated_at":"2015-05-08T13:13:16Z","pushed_at":"2015-11-18T12:23:52Z","git_url":"git://github.com/cogneco/ooc-kean.git","ssh_url":"git@github.com:cogneco/ooc-kean.git","clone_url":"https://github.com/cogneco/ooc-kean.git","svn_url":"https://github.com/cogneco/ooc-kean","homepage":"","size":27861,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":85,"forks":18,"open_issues":85,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/824"},"issue":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/824"},"comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/824/comments"},"review_comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824/comments"},"review_comment":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/824/commits"},"statuses":{"href":"https://api.github.com/repos/cogneco/ooc-kean/statuses/e75528b0a1b99bbb4262aacee6020a15bfe8e41d"}}}}