#include "PreviewImage.h"
+#include "Buffer.h"
#include "Dimension.h"
#include "GraphicsImage.h"
#include "GraphicsLoader.h"
namespace lyx {
namespace graphics {
-class PreviewImage::Impl : public boost::signals::trackable {
+class PreviewImage::Impl : public boost::signals2::trackable {
public:
///
Impl(PreviewImage & p, PreviewLoader & l,
PreviewImage::Impl::~Impl()
{
- iloader_.filename().removeFile();
+ // If these images are generated for a clone, then that may be
+ // because we are previewing. We therefore do not want to delete
+ // them when this Buffer is destroyed.
+ if (!ploader_.buffer().isClone())
+ iloader_.filename().removeFile();
}