diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-10 21:33:16 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-10 21:33:16 +0200 |
commit | d2d8c8138f492a47503d6932ea053bf3dab4a3a7 (patch) | |
tree | 9d5f5f832a0fb19a97b32facf1ffb42bc9df7f14 | |
parent | 15cd12300dccf958ebbd2da2c06005d2264fa890 (diff) |
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
-rw-r--r-- | src/bookmarks.c | 11 |
1 files changed, 11 insertions, 0 deletions
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) { | |||
214 | lock_Mutex(d->mtx); | 214 | lock_Mutex(d->mtx); |
215 | iBookmark *bm = (iBookmark *) remove_Hash(&d->bookmarks, id); | 215 | iBookmark *bm = (iBookmark *) remove_Hash(&d->bookmarks, id); |
216 | if (bm) { | 216 | if (bm) { |
217 | /* If this is a remote source, make sure all the remote bookmarks are | ||
218 | removed as well. */ | ||
219 | if (hasTag_Bookmark(bm, "remotesource")) { | ||
220 | iForEach(Hash, i, &d->bookmarks) { | ||
221 | iBookmark *j = (iBookmark *) i.value; | ||
222 | if (j->sourceId == id_Bookmark(bm)) { | ||
223 | remove_HashIterator(&i); | ||
224 | delete_Bookmark(j); | ||
225 | } | ||
226 | } | ||
227 | } | ||
217 | delete_Bookmark(bm); | 228 | delete_Bookmark(bm); |
218 | } | 229 | } |
219 | unlock_Mutex(d->mtx); | 230 | unlock_Mutex(d->mtx); |