gulong delete_range_id;
gulong notify_cursor_position_id;
+ /* Source func ID for update_misspelled_words() */
+ guint update_misspelled_words_id;
+
GtkWidget *widget;
GtkWidget *hpaned;
GtkWidget *vbox_left;
update_misspelled_words (gpointer data)
{
EmpathyChat *chat = EMPATHY_CHAT (data);
+ EmpathyChatPriv *priv = GET_PRIV (chat);
GtkTextBuffer *buffer;
GtkTextIter iter;
gint length;
length = gtk_text_iter_get_offset (&iter);
chat_input_text_buffer_insert_text_cb (buffer, &iter,
NULL, length, chat);
+
+ priv->update_misspelled_words_id = 0;
+
return FALSE;
}
/* Possibly changed dictionaries,
* update misspelled words. Need to do so in idle
* so the spell checker is updated. */
- g_idle_add (update_misspelled_words, chat);
+ priv->update_misspelled_words_id =
+ g_idle_add (update_misspelled_words, chat);
}
return;
/* Mark misspelled words in the existing buffer.
* Need to do so in idle so the spell checker is updated. */
- g_idle_add (update_misspelled_words, chat);
+ priv->update_misspelled_words_id =
+ g_idle_add (update_misspelled_words, chat);
} else {
GtkTextTagTable *table;
GtkTextTag *tag;
DEBUG ("Finalized: %p", object);
+ if (priv->update_misspelled_words_id != 0)
+ g_source_remove (priv->update_misspelled_words_id);
+
g_object_unref (priv->gsettings_chat);
g_object_unref (priv->gsettings_ui);