From 94c113d24ff9629f626d0bf85f99038e0348e4c5 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Mon, 14 Jun 2010 19:33:43 +0000 Subject: [PATCH] #6767 fix the crash when given language is not supported git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34656 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/AspellChecker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AspellChecker.cpp b/src/AspellChecker.cpp index 263e379c23..77c4b5bc85 100644 --- a/src/AspellChecker.cpp +++ b/src/AspellChecker.cpp @@ -217,10 +217,14 @@ AspellSpeller * AspellChecker::Private::addSpeller(string const & lang, if (aspell_error_number(m.e_speller) != 0) { // FIXME: We should indicate somehow that this language is not supported. LYXERR(Debug::FILES, "aspell error: " << aspell_error_message(m.e_speller)); + delete_aspell_can_have_error(m.e_speller); + delete_aspell_config(m.config); + m.config = 0; + m.e_speller = 0; } spellers_[spellerID(lang, variety)] = m; - return to_aspell_speller(m.e_speller); + return 0 == m.config ? 0 : to_aspell_speller(m.e_speller); }