]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewImage.cpp
Use call_once to ensure something is only called once
[lyx.git] / src / graphics / PreviewImage.cpp
index 661c8af8d19f947ac5216a4f2e2a2c252f8999bc..80e8e2013513575cc8dfc500a7d9f554d70c10b7 100644 (file)
@@ -28,7 +28,7 @@ using namespace lyx::support;
 namespace lyx {
 namespace graphics {
 
-class PreviewImage::Impl : public boost::signals::trackable {
+class PreviewImage::Impl : public boost::signals2::trackable {
 public:
        ///
        Impl(PreviewImage & p, PreviewLoader & l,
@@ -113,6 +113,9 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
 
 PreviewImage::Impl::~Impl()
 {
+       // 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();
 }