- unlock_images_cache();
-
- if (!found) {
- struct FetchCtx *ctx = g_new(struct FetchCtx, 1);
-
- /* Attached images can be loaded into cache right here. */
- if (!strncmp(src, "cid:", 4)) {
- GdkPixbuf *pixbuf = get_local_image(src);
-
- if (pixbuf != NULL)
- add_image_to_cache(src, pixbuf);
-
- return;
- }
-
- 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->url = g_strdup(url.c_str());
- ctx->container = this;
-
- GTask *task = g_task_new(this, NULL, get_image_callback, ctx);
- g_task_set_task_data(task, ctx, NULL);
- g_task_run_in_thread(task, get_image_threaded);
- } else {
- debug_print("found image in cache: '%s'\n", url.c_str());
- }
-}
-
-void container_linux::get_image_size( const litehtml::tchar_t* src, const litehtml::tchar_t* baseurl, litehtml::size& sz )
-{
- litehtml::tstring url;
- make_url(src, baseurl, url);
- bool found = false;
- const image *img = NULL;
-
- lock_images_cache();
-
- for (auto ii = m_images.cbegin(); ii != m_images.cend(); ++ii) {
- const image *i = &(*ii);
- if (i->first == url) {
- img = i;
- found = true;
- break;
- }
+ if(i->second.first != NULL && i->second.first != image) {
+ g_warning("pixbuf pointer for image '%s' changed", url);
+ g_object_unref(i->second.first);