Fix bug noticed by Pavel. Apparently, some changes Abdel made to preview loading for 2.1.x broke LyXHTML preview of math as images.

We have been here before. The png files are generated, but then by the time we preview the document, they are gone. This is because (a) when the PreviewLoader for a Buffer is deleted, it removes all its previews and (b) we export in a clone, so that Buffer gets deleted before the preview is actually shown. So we need to check whether we are a preview for a clone before we delete anything.
This commit is contained in:
Richard Heck 2015-07-22 11:04:35 -04:00
parent 2ddad383ea
commit 17a033c15a

View File

@ -12,6 +12,7 @@
#include "PreviewImage.h"
#include "Buffer.h"
#include "Dimension.h"
#include "GraphicsImage.h"
#include "GraphicsLoader.h"
@ -112,7 +113,8 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
PreviewImage::Impl::~Impl()
{
iloader_.filename().removeFile();
if (!ploader_.buffer().isClone())
iloader_.filename().removeFile();
}