fix: SIGSEGV when call after closed
When close
called, a resource which handle points is freed in libhunspell
, but handle does not become null
.
There are null
checks in spell
and add
methods. But they are non-sense because handle
is always not null
, and suggest
method don't have the check.
This fix the issue with set handle
to null
when closed, and check null
in a suggest
method.
The bug is reported on downstream project languagetool and its user OmegaT application.
Ref: languagetool project issue and pull-request ticket https://github.com/languagetool-org/languagetool/pull/8772
Ref: OmegaT project issue ticket https://sourceforge.net/p/omegat/bugs/1182/
Signed-off-by: Hiroshi Miura miurahr@linux.com