From 44466f305f047312afb336466d5a3c3050c75584 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 6 Jun 2018 18:59:37 +0200 Subject: [PATCH] Avoid duplicate generation of the same preview When an image has to be loaded a second time and the cache is not used or the image is not in the cache, its preview is going to be regenerated again. Hence, if the same image appears more than once on screen, avoid requesting simultaneous generation of the same preview. See also this thread: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg205057.html --- src/graphics/GraphicsLoader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index 683f0925fc..c38761c85b 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -299,7 +299,8 @@ void Loader::reset(Params const & params) const void Loader::startLoading() const { - if (pimpl_->status_ != WaitingToLoad || !pimpl_->cached_item_) + if (pimpl_->status_ != WaitingToLoad || !pimpl_->cached_item_ + || pimpl_->cached_item_->status() == Converting) return; pimpl_->startLoading(); } -- 2.39.5