talons

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

commit dae174542ee5a97c297a0e2491d3820fa0c6ff4c
parent 4a03c10db14d4ca7d8490aa48281817f528a6b28
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);