]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/container.h
Use std::unique_ptr for managing memory
[libs/gltk.git] / source / container.h
index 45985bc0ad585c304d5735f2ad037b016bbdc53b..6311a411a57fb1b16e03dcdd24564242a2ac5902 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GLTK_CONTAINER_H_
 #define MSP_GLTK_CONTAINER_H_
 
+#include <memory>
 #include <stdexcept>
 #include <vector>
 #include <sigc++/trackable.h>
@@ -37,7 +38,7 @@ protected:
                void rebuild_needed();
        };
 
-       std::vector<Child *> children;
+       std::vector<std::unique_ptr<Child>> children;
        Widget *click_focus = nullptr;
        unsigned click_button = 0;
        Widget *pointer_focus = nullptr;