diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib/ephy-node.c | 19 |
2 files changed, 22 insertions, 8 deletions
@@ -1,5 +1,16 @@ 2003-07-06 Christian Persch <chpe@cvs.gnome.org> + * lib/ephy-node.c: (ephy_node_finalize): + + Fix mem leak. + + * lib/ephy-node.c: (ephy_node_save_to_xml), (ephy_node_new_from_xml): + + Use locale-independent functions g_ascii_strtod and g_ascii_dtostr + when reading/writing float and double values. + +2003-07-06 Christian Persch <chpe@cvs.gnome.org> + * embed/ephy-favicon-cache.c: (ephy_favicon_cache_finalize): Fix mem leak. diff --git a/lib/ephy-node.c b/lib/ephy-node.c index 6b88c352f..6d9d9adab 100644 --- a/lib/ephy-node.c +++ b/lib/ephy-node.c @@ -22,6 +22,7 @@ #include <config.h> #endif +#include <glib.h> #include <bonobo/bonobo-i18n.h> #include <stdlib.h> #include <string.h> @@ -206,6 +207,7 @@ ephy_node_finalize (EphyNode *node) g_ptr_array_free (node->children, FALSE); g_static_rw_lock_free (node->lock); + g_free (node->lock); g_free (node); } @@ -781,6 +783,7 @@ ephy_node_save_to_xml (EphyNode *node, { xmlNodePtr xml_node; char *xml; + char xml_buf [G_ASCII_DTOSTR_BUF_SIZE]; guint i; g_return_if_fail (EPHY_IS_NODE (node)); @@ -834,14 +837,14 @@ ephy_node_save_to_xml (EphyNode *node, g_free (xml); break; case G_TYPE_FLOAT: - xml = g_strdup_printf ("%f", g_value_get_float (value)); - xmlNodeSetContent (value_xml_node, xml); - g_free (xml); + g_ascii_dtostr (xml_buf, sizeof (xml_buf), + g_value_get_float (value)); + xmlNodeSetContent (value_xml_node, xml_buf); break; case G_TYPE_DOUBLE: - xml = g_strdup_printf ("%f", g_value_get_double (value)); - xmlNodeSetContent (value_xml_node, xml); - g_free (xml); + g_ascii_dtostr (xml_buf, sizeof (xml_buf), + g_value_get_double (value)); + xmlNodeSetContent (value_xml_node, xml_buf); break; case G_TYPE_POINTER: { @@ -967,10 +970,10 @@ ephy_node_new_from_xml (EphyNodeDb *db, xmlNodePtr xml_node) g_value_set_long (value, atol (xml)); break; case G_TYPE_FLOAT: - g_value_set_float (value, atof (xml)); + g_value_set_float (value, g_ascii_strtod (xml, NULL)); break; case G_TYPE_DOUBLE: - g_value_set_double (value, atof (xml)); + g_value_set_double (value, g_ascii_strtod (xml, NULL)); break; case G_TYPE_POINTER: { |