Joost Verburg wrote:
> Bo Peng wrote:
>> Why lyx/aspell/mingw works but lyx/aspell/msvc does not? Is it because
>> we use standard aspell under mingw, but cvs aspell under msvc?
> 
> No, it's not related to the Aspell version. I don't know the details,
> Peter says a pointer managed by lyx is null when it is dereferenced.
> 
> Maybe he can provide some more details about what needs to be fixed.
> 
> Joost
> 
> 

This patch

Index: ControlSpellchecker.C
===================================================================
--- ControlSpellchecker.C       (revision 14851)
+++ ControlSpellchecker.C       (working copy)
@@ -259,11 +259,11 @@

 bool ControlSpellchecker::checkAlive()
 {
-       if (speller_->alive() && speller_->error().empty())
+       if (speller_ && speller_->alive() && speller_->error().empty())
                return true;

        string message;
-       if (speller_->error().empty())
+       if (!speller_ || speller_->error().empty())
                message = _("The spellchecker has died for some reason.\n"
                            "Maybe it has been killed.");
        else


avoids the crash because speller_ is 0, but you come into a endless
dialog loop when you wanna close the spell checker.


speller_ is a smart ptr:


frontends/controllers/ControlSpellchecker.h
class ControlSpellchecker : public Dialog::Controller {
....
        /// The actual spellchecker object
        boost::scoped_ptr<SpellBase> speller_;
};


which lyx resets before the crash:

void ControlSpellchecker::clearParams()
{
        lyxerr[Debug::GUI] << "Spellchecker::clearParams" << endl;
        speller_.reset(0);
}


But ATM  don't understand the control flow, so I couldn't find the
real reason for this.

Peter


Reply via email to