a3358c0d6f
fix segfault in mcedit when pressing alt-minus
40 lines
1.6 KiB
Diff
40 lines
1.6 KiB
Diff
Index: src/editor/spell.c
|
|
===================================================================
|
|
--- src/editor/spell.c (revision 94bd4b1f78901cd83406f3daa9a0d0f8f2152321)
|
|
+++ src/editor/spell.c (revision a8429411758003fab3b9f27e6bccad6b6b5c2d3c)
|
|
@@ -72,7 +72,5 @@
|
|
static const char *(*mc_aspell_config_retrieve) (struct AspellConfig * ths, const char *key);
|
|
static void (*mc_delete_aspell_speller) (struct AspellSpeller * ths);
|
|
-/*
|
|
- static void (*mc_delete_aspell_config) (struct AspellConfig * ths);
|
|
- */
|
|
+static void (*mc_delete_aspell_config) (struct AspellConfig * ths);
|
|
static void (*mc_delete_aspell_can_have_error) (struct AspellCanHaveError * ths);
|
|
static const char *(*mc_aspell_error_message) (const struct AspellCanHaveError * ths);
|
|
@@ -229,5 +227,5 @@
|
|
goto error_ret;
|
|
|
|
- if (!g_module_symbol (spell_module, "delete_aspell_config", (void *) &mc_delete_aspell_speller))
|
|
+ if (!g_module_symbol (spell_module, "delete_aspell_config", (void *) &mc_delete_aspell_config))
|
|
goto error_ret;
|
|
|
|
@@ -312,5 +310,5 @@
|
|
edit_error_dialog (_("Error"), mc_aspell_error_message (error));
|
|
mc_delete_aspell_can_have_error (error);
|
|
- g_free (global_speller);
|
|
+ aspell_clean ();
|
|
}
|
|
}
|
|
@@ -327,5 +325,10 @@
|
|
return;
|
|
|
|
- mc_delete_aspell_speller (global_speller->speller);
|
|
+ if (global_speller->speller != NULL)
|
|
+ mc_delete_aspell_speller (global_speller->speller);
|
|
+
|
|
+ if (global_speller->config != NULL)
|
|
+ mc_delete_aspell_config (global_speller->config);
|
|
+
|
|
g_free (global_speller);
|
|
global_speller = NULL;
|