2005-09-13 [colin] 1.9.14cvs24
authorColin Leroy <colin@colino.net>
Tue, 13 Sep 2005 17:38:03 +0000 (17:38 +0000)
committerColin Leroy <colin@colino.net>
Tue, 13 Sep 2005 17:38:03 +0000 (17:38 +0000)
* src/gtk/gtkaspell.c
Fix non-utf8 in menu
Fix little leaks
Nullify struct members after free()s

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/gtk/gtkaspell.c

index d4e6b03e5bc4530bbff09c4bff7c5ff24801c50f..38aa88eae733636b7c2f2aec47d5f2f72e370336 100644 (file)
@@ -1,3 +1,10 @@
+2005-09-13 [colin]     1.9.14cvs24
+
+       * src/gtk/gtkaspell.c
+               Fix non-utf8 in menu
+               Fix little leaks
+               Nullify struct members after free()s
+
 2005-09-13 [colin]     1.9.14cvs23
 
        * src/compose.c
index cf9e65e16f6fb128c74e8e3931a94d8050fd41af..8116f0da90941985c7dfd428b9e317b09b1d37fb 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.100.2.25 -r 1.100.2.26 AUTHORS;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/gtk/logwindow.c;  ) > 1.9.14cvs21.patchset
 ( cvs diff -u -r 1.382.2.166 -r 1.382.2.167 src/compose.c;  cvs diff -u -r 1.274.2.64 -r 1.274.2.65 src/mainwindow.c;  cvs diff -u -r 1.395.2.122 -r 1.395.2.123 src/summaryview.c;  cvs diff -u -r 1.68.2.11 -r 1.68.2.12 src/summaryview.h;  ) > 1.9.14cvs22.patchset
 ( cvs diff -u -r 1.382.2.167 -r 1.382.2.168 src/compose.c;  cvs diff -u -r 1.3.2.25 -r 1.3.2.26 src/prefs_themes.c;  cvs diff -u -r 1.49.2.58 -r 1.49.2.59 src/procmime.c;  cvs diff -u -r 1.150.2.43 -r 1.150.2.44 src/procmsg.c;  cvs diff -u -r 1.9.2.21 -r 1.9.2.22 src/gtk/gtkaspell.c;  ) > 1.9.14cvs23.patchset
+( cvs diff -u -r 1.9.2.22 -r 1.9.2.23 src/gtk/gtkaspell.c;  ) > 1.9.14cvs24.patchset
index 27003d6064d06bc8c3e4d59f08e9373545d948b9..69a3f59271dc940070934d7845aaab7ef25641b5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=23
+EXTRA_VERSION=24
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e8e26f87e9febcb0fbf77ddaa9f0ba433979aebd..7144718f845d1ffa4bd88093d00d0b202d0739a3 100644 (file)
@@ -325,6 +325,7 @@ void gtkaspell_checkers_quit(void)
 
                g_slist_foreach(checkers, free_checkers, NULL);
                g_slist_free(checkers);
+               gtkaspellcheckers->checkers = NULL;
        }
 
        if ((dict_list = gtkaspellcheckers->dictionary_list)) {
@@ -336,7 +337,7 @@ void gtkaspell_checkers_quit(void)
        }
 
        g_free(gtkaspellcheckers->error_message);
-
+       gtkaspellcheckers->error_message = NULL;
        return;
 }
 
@@ -470,6 +471,7 @@ void gtkaspell_delete(GtkAspell * gtkaspell)
                free_suggestions_list(gtkaspell);
 
        g_free((gchar *)gtkaspell->dictionary_path);
+       gtkaspell->dictionary_path = NULL;
 
        debug_print("Aspell: deleting gtkaspell %0x\n", (guint) gtkaspell);
 
@@ -1924,10 +1926,14 @@ static GtkMenu *make_sug_menu(GtkAspell *gtkaspell)
        g_signal_connect(G_OBJECT(menu), "cancel",
                         G_CALLBACK(cancel_menu_cb), gtkaspell);
 
+       utf8buf  = conv_codeset_strdup((unsigned char*)l->data,
+                               conv_get_locale_charset_str(),
+                               CS_UTF_8);
        caption = g_strdup_printf(_("\"%s\" unknown in %s"), 
-                                 (unsigned char*) l->data
+                                 utf8buf
                                  gtkaspell->gtkaspeller->dictionary->dictname);
        item = gtk_menu_item_new_with_label(caption);
+       g_free(utf8buf);
        gtk_widget_show(item);
        gtk_menu_append(GTK_MENU(menu), item);
        gtk_misc_set_alignment(GTK_MISC(GTK_BIN(item)->child), 0.5, 0.5);
@@ -2016,6 +2022,7 @@ static GtkMenu *make_sug_menu(GtkAspell *gtkaspell)
                                                        conv_get_locale_charset_str(),
                                                        CS_UTF_8);
                        item = gtk_menu_item_new_with_label(utf8buf);
+                       g_free(utf8buf);
                        gtk_widget_show(item);
                        gtk_menu_append(GTK_MENU(curmenu), item);
                        g_signal_connect(G_OBJECT(item), "activate",
@@ -2299,6 +2306,7 @@ gboolean gtkaspell_change_dict(GtkAspell *gtkaspell, const gchar *dictionary)
            dict == gtkaspell->alternate_speller->dictionary) {
                use_alternate_dict(gtkaspell);
                dictionary_delete(dict);
+               gtkaspell->alternate_speller->dictionary = NULL;
                return TRUE;
        }
        
@@ -2480,7 +2488,7 @@ static void free_suggestions_list(GtkAspell *gtkaspell)
             list = list->next)
                g_free(list->data);
 
-       g_list_free(list);
+       g_list_free(gtkaspell->suggestions_list);
        
        gtkaspell->max_sug          = -1;
        gtkaspell->suggestions_list = NULL;