]> git.lyx.org Git - features.git/commitdiff
Avoid duplicate generation of the same preview
authorEnrico Forestieri <forenr@lyx.org>
Wed, 6 Jun 2018 16:59:37 +0000 (18:59 +0200)
committerPavel Sanda <sanda@lyx.org>
Thu, 7 Jun 2018 21:13:33 +0000 (23:13 +0200)
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

index 683f0925fc603a8e2b8b4687fcf9bd3fc0e5d67b..c38761c85b7d8b95a693b3e95e205c8d17990369 100644 (file)
@@ -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();
 }