On 12/04/2009 12:38 PM, rgh...@lyx.org wrote:
Author: rgheck
Date: Fri Dec  4 18:38:30 2009
New Revision: 32339
URL: http://www.lyx.org/trac/changeset/32339

Log:
Fix strange problem reported by Stefano Franchi.

Can someone else have a look at this? You can get the crash by (a) failing to set the hunspell path in Preferences, and then uncommenting the Frontend::Alert line below.

Richard

Modified:
    lyx-devel/trunk/src/HunspellChecker.cpp

Modified: lyx-devel/trunk/src/HunspellChecker.cpp
==============================================================================
--- lyx-devel/trunk/src/HunspellChecker.cpp     Fri Dec  4 17:08:39 2009        
(r32338)
+++ lyx-devel/trunk/src/HunspellChecker.cpp     Fri Dec  4 18:38:30 2009        
(r32339)
@@ -92,13 +92,19 @@
        string hunspell_path = external_path(lyxrc.hunspelldir_path);
        LYXERR(Debug::FILES, "hunspell path: "<<  hunspell_path);
        if (hunspell_path.empty()) {
+               // FIXME We'd like to issue a better error message here, but 
there seems
+               // to be a problem about thread safety, or something of the 
sort. If
+               // we issue the message using frontend::Alert, then the code 
comes
+               // back through here while the box is waiting, and causes some 
kind
+               // of crash.
                static bool warned = false;
                if (!warned) {
-                       frontend::Alert::error(_("Hunspell Path Not Found"),
-                                       _("You must set the Hunspell dictionary path in 
Tools>Preferences>Paths."));
                        warned = true;
+                       LYXERR0("Hunspell path not set.");
+                       //frontend::Alert::error(_("Hunspell Path Not Found"),
+                       //              _("You must set the Hunspell dictionary path in 
Tools>Preferences>Paths."));
                }
-               return false;
+               return 0;
        }

        hunspell_path += "/" + lang;

Reply via email to