Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak in aspell_list_misspelled and aspell_correct_lines #8

Open
drbrain opened this issue Apr 5, 2012 · 1 comment
Open

Comments

@drbrain
Copy link

drbrain commented Apr 5, 2012

raspell contains memory leaks in list_misspelled and correct_lines due to not using rb_ensure to call delete_aspell_document_checker and free the checker. In list_misspelled, if an exception is railed from rb_yield or rb_funcall then delete_aspell_document_checker will not be called. The same is true in aspell_correct_lines.

Here is an example illustrating the leak using list_misspelled:

require 'raspell'

checker = Aspell.new 'en_US'
1_000_000.times do
  begin
    checker.list_misspelled %w[wraung] do
      raise
    end
  rescue
  end
end
@evan
Copy link
Owner

evan commented Apr 12, 2012

I don't personally use Raspell anymore so mostly I curate pull requests...patches welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants