// (C) 2011 Underground Software
// See the README and GPLv3 files for licensing and warranty information
//
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
//
// 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"
Container::~Container()
{
+ // No memory leaks!
+ while (objects.size() > 0)
+ {
+ delete objects[0];
+ objects.erase(objects.begin());
+ }
}
-/*virtual*/ void Container::Draw(QPainter * painter)
+/*virtual*/ void Container::Draw(Painter * painter)
{
for(int i=0; i<(int)objects.size(); i++)
objects[i]->Draw(painter);