Fix clearing local images from litehtml cache
The cache clearing logic was double incrementing for cid: images, going into an infinite loop if a cid: image was the last one checked
This commit is contained in:
parent
481897fc2a
commit
10349d5e49
1 changed files with 3 additions and 1 deletions
|
@ -229,11 +229,13 @@ gint container_linux::clear_images(gsize desired_size)
|
|||
lock_images_cache();
|
||||
|
||||
/* First, remove all local images - the ones with "cid:" URL. */
|
||||
for (auto i = m_images.begin(); i != m_images.end(); ++i) {
|
||||
for (auto i = m_images.begin(); i != m_images.end(); ) {
|
||||
if (!strncmp(i->first.c_str(), "cid:", 4)) {
|
||||
g_object_unref(i->second.first);
|
||||
i = m_images.erase(i);
|
||||
num++;
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue