Here is a porting of Angus' recent spellchecker crash patch to
1.2.2cvs. Since I do not know the code, and do not know even how this
crash was supposed to happen, I'd like somebody to take a look before
I commit it. It looks sane to me, but who am I to judge?

JMarc

Index: status.12x
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/Attic/status.12x,v
retrieving revision 1.1.2.74
diff -u -p -r1.1.2.74 status.12x
--- status.12x	19 Nov 2002 10:33:18 -0000	1.1.2.74
+++ status.12x	19 Nov 2002 10:55:21 -0000
@@ -53,6 +53,8 @@ What's new
 
 - fix bug with handling of EPSI files (this was a new bug in 1.2.1)
 
+- fix crash when the ispell process dies
+
 - fix crash with undo
 
 - fix lockup when changing the layout of several paragraphs at the
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.173.2.7
diff -u -p -r1.173.2.7 ChangeLog
--- src/frontends/controllers/ChangeLog	14 Oct 2002 14:28:29 -0000	1.173.2.7
+++ src/frontends/controllers/ChangeLog	19 Nov 2002 10:55:21 -0000
@@ -1,3 +1,7 @@
+2002-11-19  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* ControlSpellchecker.C (check): avoid crash if spellchecker dies
+
 2002-10-14  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* several files: move the inclusion of .tmpl files from .C files
Index: src/frontends/controllers/ControlSpellchecker.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v
retrieving revision 1.16
diff -u -p -r1.16 ControlSpellchecker.C
--- src/frontends/controllers/ControlSpellchecker.C	21 Mar 2002 21:21:27 -0000	1.16
+++ src/frontends/controllers/ControlSpellchecker.C	19 Nov 2002 10:55:21 -0000
@@ -134,7 +134,11 @@ void ControlSpellchecker::check()
 			view().partialUpdate(0);
 		}
 
-		if (!speller_->alive()) clearParams();
+		if (!speller_ || !speller_->alive()) {
+			clearParams();
+			stop();
+			return;
+		}
 
 		result_ = speller_->check(word_);
 	}

Reply via email to