The attached patch explains the problem and offers a simple solution. This is master-only, and it needs to go into 2.1. OK?

Richard

>From 55e562c18eaff4c42629fb215e6729363bb5ca7a Mon Sep 17 00:00:00 2001
From: Richard Heck <rgh...@lyx.org>
Date: Sun, 4 Aug 2013 17:40:35 -0400
Subject: [PATCH] Fix View> LyXXHTML when math is generated as images. The
 rewrite to the preview mechanism broke this, since the
 images get deleted just as the file is being viewed.

Probably, a better solution would be to copy the images we know we
need, and somehow tell the main buffer about them, rather than leaving
all the generated previews lying around. But this works for now.
---
 src/graphics/PreviewImage.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/graphics/PreviewImage.cpp b/src/graphics/PreviewImage.cpp
index 3185365..5772927 100644
--- a/src/graphics/PreviewImage.cpp
+++ b/src/graphics/PreviewImage.cpp
@@ -12,6 +12,7 @@
 
 #include "PreviewImage.h"
 
+#include "Buffer.h"
 #include "Dimension.h"
 #include "GraphicsImage.h"
 #include "GraphicsLoader.h"
@@ -111,7 +112,8 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
 
 PreviewImage::Impl::~Impl()
 {
-	iloader_.filename().removeFile();
+	if (!ploader_.buffer().isClone())
+		iloader_.filename().removeFile();
 }
 
 
-- 
1.7.11.7

Reply via email to