--- epiphany-0.6.0/src/bookmarks/ephy-bookmarks.c.bak	2003-05-03 14:16:48.000000000 +0300
+++ epiphany-0.6.0/src/bookmarks/ephy-bookmarks.c	2003-05-04 02:48:35.000000000 +0300
@@ -233,6 +233,8 @@
 				    default_bookmarks[i].location,
 				    default_bookmarks[i].smart_url);
 	}
+
+	ephy_bookmarks_save (eb);
 }
 
 static gboolean
@@ -266,7 +268,7 @@
 	return TRUE;
 }
 
-static void
+void
 ephy_bookmarks_save (EphyBookmarks *eb)
 {
 	xmlDocPtr doc;
@@ -312,6 +314,7 @@
 	ephy_node_thaw (eb->priv->bookmarks);
 
 	xmlSaveFormatFile (eb->priv->xml_file, doc, 1);
+	xmlFreeDoc(doc);
 }
 
 static double
@@ -707,7 +710,6 @@
 	ephy_node_add_child (eb->priv->notcategorized, bm);
 
 	ephy_bookmarks_emit_data_changed (eb);
-	ephy_bookmarks_save (eb);
 
 	return bm;
 }
--- epiphany-0.6.0/src/bookmarks/ephy-bookmarks.h.bak	2003-05-04 02:46:39.000000000 +0300
+++ epiphany-0.6.0/src/bookmarks/ephy-bookmarks.h	2003-05-04 02:48:02.000000000 +0300
@@ -69,6 +69,8 @@
 
 /* Bookmarks */
 
+void		ephy_bookmarks_save		(EphyBookmarks *eb);
+
 EphyNode       *ephy_bookmarks_add		(EphyBookmarks *eb,
 						 const char *title,
 						 const char *url,
--- epiphany-0.6.0/src/bookmarks/ephy-bookmarks-import.c.bak	2003-05-04 02:53:05.000000000 +0300
+++ epiphany-0.6.0/src/bookmarks/ephy-bookmarks-import.c	2003-05-04 02:44:14.000000000 +0300
@@ -239,6 +239,8 @@
 	g_free (keyword);
         xmlFreeDoc (doc);
 
+	ephy_bookmarks_save (bookmarks);
+
 	return TRUE;
 }
 
@@ -261,5 +263,7 @@
 
 	xmlFreeDoc (doc);
 
+	ephy_bookmarks_save (bookmarks);
+
 	return TRUE;
 }
--- epiphany-0.6.0/src/bookmarks/ephy-new-bookmark.c.bak	2003-05-04 02:39:03.000000000 +0300
+++ epiphany-0.6.0/src/bookmarks/ephy-new-bookmark.c	2003-05-04 02:41:05.000000000 +0300
@@ -174,6 +174,8 @@
 					 new_bookmark->priv->location,
 					 new_bookmark->priv->icon);
 	}
+
+	ephy_bookmarks_save (new_bookmark->priv->bookmarks);
 }
 
 static void
--- epiphany-0.6.0/ChangeLog.bak	2003-05-05 23:17:54.000000000 +0300
+++ epiphany-0.6.0/ChangeLog	2003-05-05 23:21:00.000000000 +0300
@@ -1,3 +1,13 @@
+2003-05-04 Osma Ahvenlampi <oa@iki.fi>
+
+	* src/bookmarks/ephy-bookmarks.c:
+	* src/bookmarks/ephy-bookmarks.h:
+	* src/bookmarks/ephy-bookmarks-import.c:
+	* src/bookmarks/ephy-new-bookmark.c:
+	
+	Fix memory leak while saving bookmarks, and performance problem
+	during import.
+
 2003-05-03 MArk Finlay <sisob@eircom.net>
 	   Marco Pesenti Gritti  <marco@it.gnome.org>
 
