Index: spellchk.c =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/spellchk.c,v retrieving revision 1.91 diff -u -p -r1.91 spellchk.c --- spellchk.c 3 Nov 2005 04:40:52 -0000 1.91 +++ spellchk.c 3 Nov 2005 18:27:00 -0000 @@ -581,6 +581,27 @@ spellchk_new_attach(GaimConversation *c) return; } +static void spellchk_detach(GaimConversation *c) +{ + spellchk *spell; + GaimGtkConversation *gtkconv; + GtkTextView *view; + + gtkconv = GAIM_GTK_CONVERSATION(c); + + view = GTK_TEXT_VIEW(gtkconv->entry); + + spell = g_object_get_data(G_OBJECT(view), SPELLCHK_OBJECT_KEY); + + if (spell == NULL) + return; + + g_object_set_data(G_OBJECT(view), SPELLCHK_OBJECT_KEY, NULL); + + /* spellchk_free deals with disconnecting signal handlers too */ + spellchk_free(spell); +} + static int buf_get_line(char *ibuf, char **buf, int *position, int len) { int pos = *position; @@ -1938,6 +1959,20 @@ plugin_load(GaimPlugin *plugin) return TRUE; } +static gboolean +plugin_unload(GaimPlugin *plugin) +{ + GList *convs; + + /* Detach from existing conversations */ + for (convs = gaim_get_conversations(); convs != NULL; convs = convs->next) + { + spellchk_detach((GaimConversation *)convs->data); + } + + return TRUE; +} + static GtkWidget * get_config_frame(GaimPlugin *plugin) { @@ -2108,7 +2143,7 @@ static GaimPluginInfo info = "Eric Warmenhoven ", GAIM_WEBSITE, plugin_load, - NULL, + plugin_unload, NULL, &ui_info, NULL,