diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-import.c | 4 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks.h | 2 | ||||
-rw-r--r-- | src/bookmarks/ephy-new-bookmark.c | 2 |
5 files changed, 22 insertions, 2 deletions
@@ -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-06 Christian Rose <menthos@menthos.com> * configure.in: Added sr and sr@Latn to ALL_LINGUAS. diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c index ebcc1a0e2..e767ad879 100644 --- a/src/bookmarks/ephy-bookmarks-import.c +++ b/src/bookmarks/ephy-bookmarks-import.c @@ -239,6 +239,8 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks, g_free (keyword); xmlFreeDoc (doc); + ephy_bookmarks_save (bookmarks); + return TRUE; } @@ -261,5 +263,7 @@ ephy_bookmarks_import_xbel (EphyBookmarks *bookmarks, xmlFreeDoc (doc); + ephy_bookmarks_save (bookmarks); + return TRUE; } diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 91c3e9c24..f8eb28469 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -247,6 +247,8 @@ ephy_bookmarks_init_defaults (EphyBookmarks *eb) id = ephy_bookmarks_get_bookmark_id (eb, default_bookmarks[i].location); ephy_toolbars_model_add_bookmark (model, FALSE, id); } + + ephy_bookmarks_save (eb); } static gboolean @@ -280,7 +282,7 @@ ephy_bookmarks_load (EphyBookmarks *eb) return TRUE; } -static void +void ephy_bookmarks_save (EphyBookmarks *eb) { xmlDocPtr doc; @@ -326,6 +328,7 @@ ephy_bookmarks_save (EphyBookmarks *eb) ephy_node_thaw (eb->priv->bookmarks); xmlSaveFormatFile (eb->priv->xml_file, doc, 1); + xmlFreeDoc(doc); } static double @@ -721,7 +724,6 @@ ephy_bookmarks_add (EphyBookmarks *eb, ephy_node_add_child (eb->priv->notcategorized, bm); ephy_bookmarks_emit_data_changed (eb); - ephy_bookmarks_save (eb); return bm; } diff --git a/src/bookmarks/ephy-bookmarks.h b/src/bookmarks/ephy-bookmarks.h index 0ab70af8e..162937c61 100644 --- a/src/bookmarks/ephy-bookmarks.h +++ b/src/bookmarks/ephy-bookmarks.h @@ -69,6 +69,8 @@ EphyBookmarks *ephy_bookmarks_new (void); /* Bookmarks */ +void ephy_bookmarks_save (EphyBookmarks *eb); + EphyNode *ephy_bookmarks_add (EphyBookmarks *eb, const char *title, const char *url, diff --git a/src/bookmarks/ephy-new-bookmark.c b/src/bookmarks/ephy-new-bookmark.c index 6394a308f..ec913b112 100644 --- a/src/bookmarks/ephy-new-bookmark.c +++ b/src/bookmarks/ephy-new-bookmark.c @@ -174,6 +174,8 @@ ephy_new_bookmark_add (EphyNewBookmark *new_bookmark) new_bookmark->priv->location, new_bookmark->priv->icon); } + + ephy_bookmarks_save (new_bookmark->priv->bookmarks); } static void |