[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pan-devel] gtkspell 2.0.0 crash fix
From: |
Evan Martin |
Subject: |
[Pan-devel] gtkspell 2.0.0 crash fix |
Date: |
Fri, 02 Aug 2002 19:21:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020614 Debian/1.0.0-3 |
This should fix at least
http://bugzilla.gnome.org/show_bug.cgi?id=88924
You shouldn't call gtkspell_attach() unless gtkspell_init() succeeded.
(This will be handled completely differently in the future.)
I haven't tested the patch, but it's pretty trivial.
(And to that user: you need to install the English dictionary for
aspell to initialize properly. On Debian, it's the "aspell-en" package.)
Index: pan/globals.h
===================================================================
RCS file: /cvs/gnome/pan/pan/globals.h,v
retrieving revision 1.19
diff -u -r1.19 globals.h
--- pan/globals.h 2002/06/21 04:59:01 1.19
+++ pan/globals.h 2002/08/03 02:17:11
@@ -47,6 +47,12 @@
stdout instead of actually
being sent. This is a
debugging tool. */
+
+#ifdef HAVE_LIBGTKSPELL
+ gboolean gtkspell_init_succeeded;
+ /* if true, we can gtkspell_attach
+ on new text widgets. */
+#endif
}
PanApp;
Index: pan/message-window.c
===================================================================
RCS file: /cvs/gnome/pan/pan/message-window.c,v
retrieving revision 1.312
diff -u -r1.312 message-window.c
--- pan/message-window.c 2002/08/02 21:50:23 1.312
+++ pan/message-window.c 2002/08/03 02:17:12
@@ -2070,7 +2070,8 @@
mw->body_view = gtk_text_view_new ();
#ifdef HAVE_LIBGTKSPELL
- gtkspell_attach (GTK_TEXT_VIEW(mw->body_view));
+ if (Pan.gtkspell_init_succeeded)
+ gtkspell_attach (GTK_TEXT_VIEW(mw->body_view));
#endif
mw->body_buffer = buf = gtk_text_view_get_buffer
(GTK_TEXT_VIEW(mw->body_view));
gtk_text_buffer_create_tag (buf, "url", "underline",
PANGO_UNDERLINE_SINGLE, "foreground_gdk", &text_url_color, NULL);
Index: pan/pan.c
===================================================================
RCS file: /cvs/gnome/pan/pan/pan.c,v
retrieving revision 1.168
diff -u -r1.168 pan.c
--- pan/pan.c 2002/07/19 23:28:38 1.168
+++ pan/pan.c 2002/08/03 02:17:12
@@ -168,7 +168,8 @@
gtk_init (&argc, &argv);
g_mime_init (GMIME_INIT_FLAG_UTF8);
#ifdef HAVE_LIBGTKSPELL
- if (gtkspell_init() < 0)
+ Pan.gtkspell_init_succeeded = (gtkspell_init() == 0);
+ if (!Pan.gtkspell_init_succeeded)
g_message ("gtkspell_init() failed!");
#endif
- [Pan-devel] gtkspell 2.0.0 crash fix,
Evan Martin <=