mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
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:
parent
2ddad383ea
commit
17a033c15a
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user