{"action":"closed","number":11,"pull_request":{"url":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11","id":54028509,"html_url":"https://github.com/dren-dk/HunspellJNA/pull/11","diff_url":"https://github.com/dren-dk/HunspellJNA/pull/11.diff","patch_url":"https://github.com/dren-dk/HunspellJNA/pull/11.patch","issue_url":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/11","number":11,"state":"closed","locked":false,"title":"Fixed some potential memory leaks.","user":{"login":"Lantigarr","id":3408844,"avatar_url":"https://avatars.githubusercontent.com/u/3408844?v=3","gravatar_id":"","url":"https://api.github.com/users/Lantigarr","html_url":"https://github.com/Lantigarr","followers_url":"https://api.github.com/users/Lantigarr/followers","following_url":"https://api.github.com/users/Lantigarr/following{/other_user}","gists_url":"https://api.github.com/users/Lantigarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Lantigarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lantigarr/subscriptions","organizations_url":"https://api.github.com/users/Lantigarr/orgs","repos_url":"https://api.github.com/users/Lantigarr/repos","events_url":"https://api.github.com/users/Lantigarr/events{/privacy}","received_events_url":"https://api.github.com/users/Lantigarr/received_events","type":"User","site_admin":false},"body":"This commit does 3 important things.\r\n\r\n1. Fixes the Long reference equality bug in Hunspell.getDictionary(String) that makes all cache lookups fail.\r\n2. Adds a finalizer to Hunspell.Dictionary to free up unmanaged memory that wasn't explicitly released.\r\n3. Adds a mechanism to prefer cached dictionaries (even when stale).\r\n\r\nThe last bullet point is important for applications because it's almost impossible to know when to call Hunspell.Dictionary.destroy. The only options that developers have is to create a caching mechanism in their application (which they can use to determine if the dictionary they just got from HunspellJNA is new and the old should be destroyed) or immediately removing new dictionaries from the cache and then destroying them afterwords.\r\n\r\nIdeally at some point HunspellJNA might decouple it's caching mechanism from Dictionary creation. Single threaded applications would then be free to use the caching mechanism (which would automatically release the memory used by dictionaries when they were replaced) and multi-threaded applications would be able to build their own caching mechanisms without the overhead of HunspellJNA's implementation.","created_at":"2015-12-17T20:38:45Z","updated_at":"2015-12-17T20:44:04Z","closed_at":"2015-12-17T20:44:03Z","merged_at":"2015-12-17T20:44:03Z","merge_commit_sha":"da7567e87b4272f65e6e351d6e41f16e5f74b54e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11/commits","review_comments_url":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11/comments","review_comment_url":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/11/comments","statuses_url":"https://api.github.com/repos/dren-dk/HunspellJNA/statuses/e2cb713e4f07e05db4780079e99b323c5b677f67","head":{"label":"Lantigarr:master","ref":"master","sha":"e2cb713e4f07e05db4780079e99b323c5b677f67","user":{"login":"Lantigarr","id":3408844,"avatar_url":"https://avatars.githubusercontent.com/u/3408844?v=3","gravatar_id":"","url":"https://api.github.com/users/Lantigarr","html_url":"https://github.com/Lantigarr","followers_url":"https://api.github.com/users/Lantigarr/followers","following_url":"https://api.github.com/users/Lantigarr/following{/other_user}","gists_url":"https://api.github.com/users/Lantigarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Lantigarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lantigarr/subscriptions","organizations_url":"https://api.github.com/users/Lantigarr/orgs","repos_url":"https://api.github.com/users/Lantigarr/repos","events_url":"https://api.github.com/users/Lantigarr/events{/privacy}","received_events_url":"https://api.github.com/users/Lantigarr/received_events","type":"User","site_admin":false},"repo":{"id":48141130,"name":"HunspellJNA","full_name":"Lantigarr/HunspellJNA","owner":{"login":"Lantigarr","id":3408844,"avatar_url":"https://avatars.githubusercontent.com/u/3408844?v=3","gravatar_id":"","url":"https://api.github.com/users/Lantigarr","html_url":"https://github.com/Lantigarr","followers_url":"https://api.github.com/users/Lantigarr/followers","following_url":"https://api.github.com/users/Lantigarr/following{/other_user}","gists_url":"https://api.github.com/users/Lantigarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Lantigarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lantigarr/subscriptions","organizations_url":"https://api.github.com/users/Lantigarr/orgs","repos_url":"https://api.github.com/users/Lantigarr/repos","events_url":"https://api.github.com/users/Lantigarr/events{/privacy}","received_events_url":"https://api.github.com/users/Lantigarr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lantigarr/HunspellJNA","description":"Hunspell library for Java based on JNA","fork":true,"url":"https://api.github.com/repos/Lantigarr/HunspellJNA","forks_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/forks","keys_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/teams","hooks_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/hooks","issue_events_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/issues/events{/number}","events_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/events","assignees_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/assignees{/user}","branches_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/branches{/branch}","tags_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/tags","blobs_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/statuses/{sha}","languages_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/languages","stargazers_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/stargazers","contributors_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/contributors","subscribers_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/subscribers","subscription_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/subscription","commits_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/contents/{+path}","compare_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/merges","archive_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/downloads","issues_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/issues{/number}","pulls_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/pulls{/number}","milestones_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/milestones{/number}","notifications_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/labels{/name}","releases_url":"https://api.github.com/repos/Lantigarr/HunspellJNA/releases{/id}","created_at":"2015-12-16T23:33:14Z","updated_at":"2015-12-16T23:33:14Z","pushed_at":"2015-12-17T18:42:23Z","git_url":"git://github.com/Lantigarr/HunspellJNA.git","ssh_url":"git@github.com:Lantigarr/HunspellJNA.git","clone_url":"https://github.com/Lantigarr/HunspellJNA.git","svn_url":"https://github.com/Lantigarr/HunspellJNA","homepage":"","size":3285,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"dren-dk:master","ref":"master","sha":"2e7b1946a59b516729fea0fc0084c009bbb729c3","user":{"login":"dren-dk","id":391959,"avatar_url":"https://avatars.githubusercontent.com/u/391959?v=3","gravatar_id":"","url":"https://api.github.com/users/dren-dk","html_url":"https://github.com/dren-dk","followers_url":"https://api.github.com/users/dren-dk/followers","following_url":"https://api.github.com/users/dren-dk/following{/other_user}","gists_url":"https://api.github.com/users/dren-dk/gists{/gist_id}","starred_url":"https://api.github.com/users/dren-dk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dren-dk/subscriptions","organizations_url":"https://api.github.com/users/dren-dk/orgs","repos_url":"https://api.github.com/users/dren-dk/repos","events_url":"https://api.github.com/users/dren-dk/events{/privacy}","received_events_url":"https://api.github.com/users/dren-dk/received_events","type":"User","site_admin":false},"repo":{"id":3728315,"name":"HunspellJNA","full_name":"dren-dk/HunspellJNA","owner":{"login":"dren-dk","id":391959,"avatar_url":"https://avatars.githubusercontent.com/u/391959?v=3","gravatar_id":"","url":"https://api.github.com/users/dren-dk","html_url":"https://github.com/dren-dk","followers_url":"https://api.github.com/users/dren-dk/followers","following_url":"https://api.github.com/users/dren-dk/following{/other_user}","gists_url":"https://api.github.com/users/dren-dk/gists{/gist_id}","starred_url":"https://api.github.com/users/dren-dk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dren-dk/subscriptions","organizations_url":"https://api.github.com/users/dren-dk/orgs","repos_url":"https://api.github.com/users/dren-dk/repos","events_url":"https://api.github.com/users/dren-dk/events{/privacy}","received_events_url":"https://api.github.com/users/dren-dk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dren-dk/HunspellJNA","description":"Hunspell library for Java based on JNA","fork":false,"url":"https://api.github.com/repos/dren-dk/HunspellJNA","forks_url":"https://api.github.com/repos/dren-dk/HunspellJNA/forks","keys_url":"https://api.github.com/repos/dren-dk/HunspellJNA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dren-dk/HunspellJNA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dren-dk/HunspellJNA/teams","hooks_url":"https://api.github.com/repos/dren-dk/HunspellJNA/hooks","issue_events_url":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/events{/number}","events_url":"https://api.github.com/repos/dren-dk/HunspellJNA/events","assignees_url":"https://api.github.com/repos/dren-dk/HunspellJNA/assignees{/user}","branches_url":"https://api.github.com/repos/dren-dk/HunspellJNA/branches{/branch}","tags_url":"https://api.github.com/repos/dren-dk/HunspellJNA/tags","blobs_url":"https://api.github.com/repos/dren-dk/HunspellJNA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dren-dk/HunspellJNA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dren-dk/HunspellJNA/git/refs{/sha}","trees_url":"https://api.github.com/repos/dren-dk/HunspellJNA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dren-dk/HunspellJNA/statuses/{sha}","languages_url":"https://api.github.com/repos/dren-dk/HunspellJNA/languages","stargazers_url":"https://api.github.com/repos/dren-dk/HunspellJNA/stargazers","contributors_url":"https://api.github.com/repos/dren-dk/HunspellJNA/contributors","subscribers_url":"https://api.github.com/repos/dren-dk/HunspellJNA/subscribers","subscription_url":"https://api.github.com/repos/dren-dk/HunspellJNA/subscription","commits_url":"https://api.github.com/repos/dren-dk/HunspellJNA/commits{/sha}","git_commits_url":"https://api.github.com/repos/dren-dk/HunspellJNA/git/commits{/sha}","comments_url":"https://api.github.com/repos/dren-dk/HunspellJNA/comments{/number}","issue_comment_url":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/comments{/number}","contents_url":"https://api.github.com/repos/dren-dk/HunspellJNA/contents/{+path}","compare_url":"https://api.github.com/repos/dren-dk/HunspellJNA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dren-dk/HunspellJNA/merges","archive_url":"https://api.github.com/repos/dren-dk/HunspellJNA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dren-dk/HunspellJNA/downloads","issues_url":"https://api.github.com/repos/dren-dk/HunspellJNA/issues{/number}","pulls_url":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls{/number}","milestones_url":"https://api.github.com/repos/dren-dk/HunspellJNA/milestones{/number}","notifications_url":"https://api.github.com/repos/dren-dk/HunspellJNA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dren-dk/HunspellJNA/labels{/name}","releases_url":"https://api.github.com/repos/dren-dk/HunspellJNA/releases{/id}","created_at":"2012-03-15T13:12:28Z","updated_at":"2015-10-19T19:27:25Z","pushed_at":"2015-12-17T20:44:04Z","git_url":"git://github.com/dren-dk/HunspellJNA.git","ssh_url":"git@github.com:dren-dk/HunspellJNA.git","clone_url":"https://github.com/dren-dk/HunspellJNA.git","svn_url":"https://github.com/dren-dk/HunspellJNA","homepage":"","size":3411,"stargazers_count":37,"watchers_count":37,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":3,"forks":20,"open_issues":3,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11"},"html":{"href":"https://github.com/dren-dk/HunspellJNA/pull/11"},"issue":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/11"},"comments":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/dren-dk/HunspellJNA/statuses/e2cb713e4f07e05db4780079e99b323c5b677f67"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"dren-dk","id":391959,"avatar_url":"https://avatars.githubusercontent.com/u/391959?v=3","gravatar_id":"","url":"https://api.github.com/users/dren-dk","html_url":"https://github.com/dren-dk","followers_url":"https://api.github.com/users/dren-dk/followers","following_url":"https://api.github.com/users/dren-dk/following{/other_user}","gists_url":"https://api.github.com/users/dren-dk/gists{/gist_id}","starred_url":"https://api.github.com/users/dren-dk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dren-dk/subscriptions","organizations_url":"https://api.github.com/users/dren-dk/orgs","repos_url":"https://api.github.com/users/dren-dk/repos","events_url":"https://api.github.com/users/dren-dk/events{/privacy}","received_events_url":"https://api.github.com/users/dren-dk/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":72,"deletions":28,"changed_files":1}}