Commit 70cf8bcc authored by Sébastien Wilmet's avatar Sébastien Wilmet

spell: do not disconnect signals on an object which will be finalized

If the tab is removed, the doc will anyway be destroyed.

It is anyway not possible for a destroyed tab to trigger a file loading
or saving.
parent 61485562
......@@ -522,22 +522,6 @@ tab_added_cb (GeditWindow *window,
init_spell_checking_in_view (plugin, gedit_tab_get_view (tab));
static void
tab_removed_cb (GeditWindow *window,
GeditTab *tab,
GeditSpellPlugin *plugin)
GeditDocument *doc = gedit_tab_get_document (tab);
/* It should still be the same doc as the one where the signal handlers
* were connected. If not, we assume that the old doc is finalized and
* it is safe to call g_signal_handlers_disconnect_by_func() if no
* signal handlers are found.
g_signal_handlers_disconnect_by_func (doc, on_document_loaded, plugin);
g_signal_handlers_disconnect_by_func (doc, on_document_saved, plugin);
static void
gedit_spell_plugin_activate (GeditWindowActivatable *activatable)
......@@ -582,11 +566,6 @@ gedit_spell_plugin_activate (GeditWindowActivatable *activatable)
G_CALLBACK (tab_added_cb),
g_signal_connect (priv->window,
G_CALLBACK (tab_removed_cb),
static void
......@@ -603,7 +582,6 @@ gedit_spell_plugin_deactivate (GeditWindowActivatable *activatable)
g_action_map_remove_action (G_ACTION_MAP (priv->window), "inline-spell-checker");
g_signal_handlers_disconnect_by_func (priv->window, tab_added_cb, activatable);
g_signal_handlers_disconnect_by_func (priv->window, tab_removed_cb, activatable);
static void
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment