diff -NurdB gnome-utils-2.10.1/gdictsrc/dict.c gnome-utils-2.10.1-patched/gdictsrc/dict.c --- gnome-utils-2.10.1/gdictsrc/dict.c 2005-02-11 11:52:44.000000000 -0500 +++ gnome-utils-2.10.1-patched/gdictsrc/dict.c 2005-07-03 19:32:02.000000000 -0500 @@ -769,9 +769,16 @@ dict_disconnect (context); g_free (context->hostname); context->hostname = NULL; + + if (context->command != NULL) { + g_free (context->command); + } + /* FOOOOOOOO, HAAAAAAAAAAACK, the notify handler still gets called, * I do not understand this, this keeps it from dieing */ /*g_free (context);*/ + /* FIXME: Are these hacks still necessary? */ + g_free (context); } /* dict_connect (context) diff -NurdB gnome-utils-2.10.1/gdictsrc/gdict-app.c gnome-utils-2.10.1-patched/gdictsrc/gdict-app.c --- gnome-utils-2.10.1/gdictsrc/gdict-app.c 2005-03-03 12:08:30.000000000 -0500 +++ gnome-utils-2.10.1-patched/gdictsrc/gdict-app.c 2005-07-03 17:40:10.000000000 -0500 @@ -545,21 +545,20 @@ } } -static void -gdict_window_close (GtkWidget *widget, GdkEvent *event, gpointer data) +static gboolean +gdict_window_delete (GtkWidget *widget, GdkEvent *event, gpointer data) { - GDictWindow *gdict = data; - if (gdict->applet != NULL) + GDictWindow *gdict = (GDictWindow *)data; + if (gdict->applet != NULL) { gtk_widget_hide (widget); - else { - gdict_windows = g_slist_remove (gdict_windows, GTK_WINDOW(gdict)); - dict_context_destroy (gdict->context); /* FIXME */ - gdict_web_search_remove_all (gdict); - g_slist_free (gdict->web_search_sites); - gtk_widget_destroy (GTK_WIDGET(gdict)); - if (gdict_windows == NULL) - gtk_main_quit (); + return TRUE; } + + gdict_windows = g_slist_remove (gdict_windows, GTK_WINDOW(gdict)); + if (gdict_windows == NULL) + gtk_main_quit (); + + return FALSE; } GtkWidget * @@ -689,7 +688,6 @@ GtkWidget *scrolled; GDictSpeller *speller; GtkWidget *window, *main_area; - GtkTooltips *tooltips; GtkToolItem *menu_button; GtkUIManager *ui; GtkWidget *menu; @@ -703,8 +701,6 @@ { "STRING", 0, 0 } }; - tooltips = gtk_tooltips_new (); - window = GTK_WIDGET (gdict); gtk_window_set_default_size (GTK_WINDOW (window), GDICT_DEFAULT_WIDTH, GDICT_DEFAULT_HEIGHT); @@ -816,7 +812,7 @@ speller->strat = gdict->pref->dfl_strat; g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (gdict_window_close), gdict); + G_CALLBACK (gdict_window_delete), gdict); gdict->speller = speller; gdict->paned = paned; @@ -839,7 +835,13 @@ static void gdict_window_finalize (GObject *object) { - GDictWindow *window = (GDictWindow *) object; + GDictWindow *gdict = (GDictWindow *) object; + + dict_context_destroy (gdict->context); /* FIXME */ + gdict_web_search_remove_all (gdict); + gdict_pref_destroy (gdict->pref); + g_slist_free (gdict->web_search_sites); + parent_class->finalize (object); } diff -NurdB gnome-utils-2.10.1/gdictsrc/gdict-applet.c gnome-utils-2.10.1-patched/gdictsrc/gdict-applet.c --- gnome-utils-2.10.1/gdictsrc/gdict-applet.c 2005-03-02 10:25:58.000000000 -0500 +++ gnome-utils-2.10.1-patched/gdictsrc/gdict-applet.c 2005-07-05 14:03:28.000000000 -0500 @@ -41,8 +41,11 @@ gtk_window_move (GTK_WINDOW (gdict), gdict->x, gdict->y); gtk_window_present (GTK_WINDOW (gdict)); - if (text==NULL || *text == 0) + if (text == NULL || *text == 0) { + if (text != NULL) + g_free (text); return; + } gtk_editable_delete_text (GTK_EDITABLE (entry), 0, -1); if (gdict->search_type == SEARCH_TYPE_REGULAR) @@ -236,6 +239,8 @@ gtk_widget_destroy (applet->entry_widget); gtk_widget_destroy (applet->box); gtk_widget_destroy (applet->applet_widget); + gtk_widget_destroy (GTK_WIDGET (applet->gdict)); + g_free (applet); } static void @@ -379,6 +384,7 @@ gdict->applet = applet; applet->gdict = gdict; + gdict_pref_load (gdict, gdict->pref); panel_applet_setup_menu_from_file (PANEL_APPLET (applet->applet_widget), NULL, "GNOME_GDictApplet.xml", @@ -395,9 +401,6 @@ NULL); } - /* server will be contacted when an action is performed */ - gdict->context = NULL; - component = panel_applet_get_popup_component (PANEL_APPLET(applet->applet_widget)); g_signal_connect (G_OBJECT (applet->applet_widget), "size_allocate", diff -NurdB gnome-utils-2.10.1/gdictsrc/gdict-pref.c gnome-utils-2.10.1-patched/gdictsrc/gdict-pref.c --- gnome-utils-2.10.1/gdictsrc/gdict-pref.c 2005-04-06 08:29:18.000000000 -0500 +++ gnome-utils-2.10.1-patched/gdictsrc/gdict-pref.c 2005-07-03 17:03:53.000000000 -0500 @@ -151,6 +151,7 @@ full_key = g_strdup_printf (GCONF_PATH, key); is_writable = gconf_client_key_is_writable (gdict_get_gconf_client (), full_key, NULL); + g_free (full_key); return is_writable; } @@ -219,7 +220,7 @@ * Loads configuration from config file */ -static void +void gdict_pref_load (GDictWindow *gdict, GDictPref *pref) { GError *error = NULL; @@ -237,9 +238,13 @@ gdict_add_gconf_notify (gdict, "smart", smart_changed_cb, gdict); + if (pref->database != NULL) + g_free (pref->database); pref->database = gdict_get_gconf_string (gdict, "database"); gdict_add_gconf_notify (gdict, "database", database_changed_cb, gdict); + if (pref->dfl_strat != NULL) + g_free (pref->dfl_strat); pref->dfl_strat = gdict_get_gconf_string (gdict, "strategy"); gdict_add_gconf_notify (gdict, "strategy", strat_changed_cb, gdict); @@ -250,9 +255,9 @@ if (!pref->port) pref->port = 2628; if (!pref->database) - pref->database = "!"; + pref->database = g_strdup ("!"); if (!pref->dfl_strat) - pref->dfl_strat = "lev"; + pref->dfl_strat = g_strdup ("lev"); } GDictPref * @@ -266,3 +271,20 @@ return pref; } + +void +gdict_pref_destroy (GDictPref *pref) +{ + g_return_if_fail (pref != NULL); + + if (pref->server != NULL) + g_free(pref->server); + + if (pref->database != NULL) + g_free (pref->database); + + if (pref->dfl_strat != NULL) + g_free (pref->dfl_strat); + + g_free (pref); +} diff -NurdB gnome-utils-2.10.1/gdictsrc/gdict-pref.h gnome-utils-2.10.1-patched/gdictsrc/gdict-pref.h --- gnome-utils-2.10.1/gdictsrc/gdict-pref.h 2004-12-21 15:13:33.000000000 -0500 +++ gnome-utils-2.10.1-patched/gdictsrc/gdict-pref.h 2005-07-03 16:18:48.000000000 -0500 @@ -54,6 +54,9 @@ GDictPref *gdict_pref_new (gpointer data); GConfClient *gdict_get_gconf_client (void); +void gdict_pref_load (GDictWindow *gdict, GDictPref *pref); +void gdict_pref_destroy (GDictPref *pref); + gboolean gdict_is_gconf_key_writable (GDictWindow *gdict, gchar *key); int gdict_get_gconf_int (GDictWindow *gdict, gchar *key);