]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/partcache.h
Use std::unique_ptr for managing memory
[libs/gltk.git] / source / partcache.h
index 71684738f0980922de8db5346d88249f53a058b5..a10efdd084e2a9b5c463fd3ac555886635bb7c36 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GLTK_PARTCACHE_H_
 #define MSP_GLTK_PARTCACHE_H_
 
+#include <memory>
 #include <msp/gl/mesh.h>
 #include <msp/gl/texture2d.h>
 #include "mspgltk_api.h"
@@ -14,12 +15,7 @@ struct CachedPart
 {
        const Part *part = nullptr;
        const GL::Texture2D *texture = nullptr;
-       GL::Mesh *mesh = nullptr;
-
-       CachedPart() = default;
-       CachedPart(CachedPart &&);
-       CachedPart &operator=(CachedPart &&);
-       ~CachedPart();
+       std::unique_ptr<GL::Mesh> mesh;
 };
 
 class MSPGLTK_API PartCache