changeset 239:25b063db93e1

2003-7-29 Brian Masney <masneyb@gftp.org> * src/gtk/options_dialog.c - fix crash that would occur when hitting apply, then ok
author masneyb
date Wed, 30 Jul 2003 00:57:32 +0000
parents 5915bb2d2c83
children 4e078f831fcf
files ChangeLog src/gtk/options_dialog.c
diffstat 2 files changed, 30 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jul 27 21:09:22 2003 +0000
+++ b/ChangeLog	Wed Jul 30 00:57:32 2003 +0000
@@ -1,3 +1,7 @@
+2003-7-29 Brian Masney <masneyb@gftp.org>
+	* src/gtk/options_dialog.c - fix crash that would occur when hitting 
+	apply, then ok
+
 2003-7-25 Brian Masney <masneyb@gftp.org>
 	* configure.in - define HAVE_OPENPTY if openpty() is found in libutil
 
@@ -1379,7 +1383,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.121 2003/07/25 20:56:26 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.122 2003/07/30 00:57:32 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/options_dialog.c	Sun Jul 27 21:09:22 2003 +0000
+++ b/src/gtk/options_dialog.c	Wed Jul 30 00:57:32 2003 +0000
@@ -427,21 +427,6 @@
 
 
 static void
-_cancel_option_type_textcomboedt (gftp_config_vars * cv, void *user_data)
-{
-  gftp_textcomboedt_widget_data * widdata;
-
-  widdata = cv->user_data;
-  if (widdata != NULL)
-    {
-      if (widdata->custom_edit_value != NULL)
-        g_free (widdata->custom_edit_value);
-      g_free (widdata);
-    }
-}
-
-
-static void
 _save_option_type_textcomboedt (gftp_config_vars * cv, void *user_data)
 {
   gftp_textcomboedt_widget_data * widdata;
@@ -492,8 +477,6 @@
 
   if (freeit)
     g_free (newstr);
-
-  _cancel_option_type_textcomboedt (cv, user_data);
 }
 
 
@@ -669,6 +652,30 @@
 static void
 clean_old_changes (GtkWidget * widget, gpointer data)
 {
+  gftp_textcomboedt_widget_data * widdata;
+  gftp_config_vars * cv;
+  GList * templist;
+  int i;
+
+  for (templist = gftp_options_list;
+       templist != NULL;
+       templist = templist->next)
+    {
+      cv = templist->data;
+
+      for (i=0; cv[i].key != NULL; i++)
+        {
+          widdata = cv->user_data;
+          if (widdata != NULL)
+            {
+              if (widdata->custom_edit_value != NULL)
+                g_free (widdata->custom_edit_value);
+              g_free (widdata);
+              cv->user_data = NULL;
+            }
+        }
+    }
+
   if (new_proxy_hosts != NULL)
     {
       gftp_free_proxy_hosts (new_proxy_hosts);
@@ -1205,7 +1212,7 @@
   _setup_option (gftp_option_type_textcomboedt, option_data, 
                  _print_option_type_textcomboedt, 
                  _save_option_type_textcomboedt,
-                 _cancel_option_type_textcomboedt);
+                 NULL);
   _setup_option (gftp_option_type_hidetext, option_data, 
                  _print_option_type_hidetext, _save_option_type_text, NULL);
   _setup_option (gftp_option_type_int, option_data,