talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 749416c7fb89ac69d002dd0e328a59ca0030105e
parent 9674154cb67aa8c9fe672a285730233ab7df68d8
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date:   Sat, 31 Jul 2021 20:40:30 -0700

LiteHTML pixbuf cache fixes

Add a missing call to unlock_images_cache

Move the check for blocking remote content to before inserting the NULL
entry into the cache.  Otherwise the NULL entries will remain if remote
content is enabled later on, which prevents further attempts to download it.

Diffstat:
Msrc/plugins/litehtml_viewer/container_linux_images.cpp | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp @@ -110,8 +110,15 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml:: if (pixbuf != NULL) m_images.insert(std::make_pair(src, std::make_pair(pixbuf, last))); + unlock_images_cache(); return; } else { + if (!lh_prefs_get()->enable_remote_content) { + debug_print("blocking download of image from '%s'\n", src); + unlock_images_cache(); + return; + } + request = true; m_images.insert(std::make_pair(url, std::make_pair((GdkPixbuf *)NULL, last))); } @@ -125,11 +132,6 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml:: if (request) { struct FetchCtx *ctx; - if (!lh_prefs_get()->enable_remote_content) { - debug_print("blocking download of image from '%s'\n", src); - return; - } - debug_print("allowing download of image from '%s'\n", src); ctx = g_new(struct FetchCtx, 1);