From d2d8c8138f492a47503d6932ea053bf3dab4a3a7 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 10 Feb 2021 21:33:16 +0200 Subject: Bookmarks: Fixed crash when removing a bookmark source Remote bookmarks from a deleted source page were not immediately removed, so the UI got confused about the missing source bookmark. IssueID #154 --- src/bookmarks.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/bookmarks.c') diff --git a/src/bookmarks.c b/src/bookmarks.c index 2efdc873..1fc24a67 100644 --- a/src/bookmarks.c +++ b/src/bookmarks.c @@ -214,6 +214,17 @@ iBool remove_Bookmarks(iBookmarks *d, uint32_t id) { lock_Mutex(d->mtx); iBookmark *bm = (iBookmark *) remove_Hash(&d->bookmarks, id); if (bm) { + /* If this is a remote source, make sure all the remote bookmarks are + removed as well. */ + if (hasTag_Bookmark(bm, "remotesource")) { + iForEach(Hash, i, &d->bookmarks) { + iBookmark *j = (iBookmark *) i.value; + if (j->sourceId == id_Bookmark(bm)) { + remove_HashIterator(&i); + delete_Bookmark(j); + } + } + } delete_Bookmark(bm); } unlock_Mutex(d->mtx); -- cgit v1.2.3