Skip to content

Commit

Permalink
Bookmarks: Fixed crash when removing a bookmark source
Browse files Browse the repository at this point in the history
Remote bookmarks from a deleted source page were not immediately
removed, so the UI got confused about the missing source bookmark.

IssueID #154
  • Loading branch information
skyjake committed Feb 14, 2021
1 parent 482ef92 commit abe1309
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bookmarks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit abe1309

Please sign in to comment.