]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem_pimpl.C
prepare for 1.1.6pre2
[lyx.git] / src / graphics / GraphicsCacheItem_pimpl.C
index dddc50da9121fbec012782c492585209ffde6df8..42d7aca00d3ae2f7d7498565d22d1f617a20918c 100644 (file)
@@ -22,6 +22,7 @@
 #include "GraphicsCacheItem.h"
 #include "GraphicsCacheItem_pimpl.h"
 
+#include "frontends/support/LyXImage.h"
 #include "graphics/XPM_Renderer.h"
 #include "graphics/EPS_Renderer.h"
 #include "support/filetools.h"
@@ -40,10 +41,7 @@ GraphicsCacheItem_pimpl::GraphicsCacheItem_pimpl()
 
 GraphicsCacheItem_pimpl::~GraphicsCacheItem_pimpl()
 {
-       if (imageStatus_ == GraphicsCacheItem::Loaded) {
-               XFreePixmap(fl_get_display(), pixmap_);
-       }
-
+       delete pixmap_;
        delete renderer;
 }
 
@@ -109,7 +107,7 @@ GraphicsCacheItem_pimpl::renderXPM(string const & filename)
        temp = ChangeExtension(filename, string());
        
        // Add some stuff to have it a unique temp file.
-       xpmfile = TmpFileName(string(), temp);
+       xpmfile = lyx::tempName(string(), temp); //TmpFileName(string(), temp);
        xpmfile = ChangeExtension(xpmfile, ".xpm");     
        
        command += xpmfile;