mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-22 18:32:16 +03:00
1) Fix corruption of history data structure on cloning
2) Only destroy urldb's thumbnail bitmap if it's not the same as the new one. This needs revisiting at a later date such that the mess surrounding who owns bitmap objects is sorted (and so that urldb doesn't need to know about bitmaps) svn path=/trunk/netsurf/; revision=3243
This commit is contained in:
parent
cc0f1c7e28
commit
b229c41e9c
@ -1067,7 +1067,7 @@ void urldb_set_thumbnail(const char *url, struct bitmap *bitmap)
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
if (p->thumb)
|
||||
if (p->thumb && p->thumb != bitmap)
|
||||
bitmap_destroy(p->thumb);
|
||||
|
||||
p->thumb = bitmap;
|
||||
|
@ -124,7 +124,7 @@ struct history *history_clone(struct history *history)
|
||||
new_history->start = history_clone_entry(new_history,
|
||||
new_history->start);
|
||||
if (!history->start) {
|
||||
LOG(("Insufficient memory to clone history"));
|
||||
LOG(("Insufficient memory to clone history"));
|
||||
warn_user("NoMemory", 0);
|
||||
history_destroy(new_history);
|
||||
return 0;
|
||||
@ -178,7 +178,7 @@ struct history_entry *history_clone_entry(struct history *history,
|
||||
for (child = new_entry->forward; child; child = child->next) {
|
||||
new_child = history_clone_entry(history, child);
|
||||
if (new_child)
|
||||
new_child->back = entry;
|
||||
new_child->back = new_entry;
|
||||
if (prev)
|
||||
prev->next = new_child;
|
||||
if (new_entry->forward == child)
|
||||
|
Loading…
Reference in New Issue
Block a user