On Fri, May 18, 2018 at 06:40:00PM +0200, Jean-Marc Lasgouttes wrote:
> Le 16/05/2018 à 20:01, Enrico Forestieri a écrit :
> > On Wed, May 16, 2018 at 01:43:45PM -0400, Richard Kimberly Heck wrote:
> > > I think you are right that it is during metrics. Tracing some things,
> > > RenderGraphic::metrics seems to be responsible for starting the preview,
> > > and it gets called from InsetGraphics::metrics.
> > > 
> > > But maybe it is as easy as expanding the cases for which we check in
> > > graphics::Loader::startLoading?
> > 
> > I tried this but it doesn't seem to work (see preview3.diff). However,
> > the patch preview2.diff should accomplish the same goal and it seems
> > to work.
> > 
> 
> preview3.diff looks like the cleanest approach to me. I think it should go
> in.

Unfortunately, it does not work, as already said. It would have been
surprising if it had worked, though, as the added condition is already
catched by "pimpl_->status_ != WaitingToLoad".

Instead, the attached works for me. Anyway, all of this appears to be racy.

-- 
Enrico
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();
 }

Reply via email to