]> Shamusworld >> Repos - architektonas/blobdiff - src/container.cpp
Added new About logo, beginnings of generic rotation tool.
[architektonas] / src / container.cpp
index 8a9c07bcc297a64193d7b8c98ee0b27e2de874c3..a5653347ab325f97aa254897c4b25383af89e116 100644 (file)
@@ -9,6 +9,8 @@
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
 // JLH  03/30/2011  Created this file
+// JLH  06/02/2011  Added code to delete objects in this container when they go
+//                  out of scope
 //
 
 #include "container.h"
@@ -23,6 +25,12 @@ Container::Container(Vector p1, Object * p/*= NULL*/): Object(p1, p),
 
 Container::~Container()
 {
+       // No memory leaks!
+       while (objects.size() > 0)
+       {
+               delete objects[0];
+               objects.erase(objects.begin());
+       }
 }
 
 /*virtual*/ void Container::Draw(QPainter * painter)