fee datapoint memory at end of testbed example

This commit is contained in:
Mason Green 2012-02-04 16:01:42 -05:00
parent 6550d6703e
commit d2469ed4ce
1 changed files with 18 additions and 1 deletions

View File

@ -77,6 +77,14 @@ bool draw_map = false;
/// Create a random distribution of points?
bool random_distribution = false;
template <class C> void FreeClear( C & cntr ) {
for ( typename C::iterator it = cntr.begin();
it != cntr.end(); ++it ) {
delete * it;
}
cntr.clear();
}
int main(int argc, char* argv[])
{
@ -198,8 +206,17 @@ int main(int argc, char* argv[])
cout << "Elapsed time (ms) = " << dt*1000.0 << endl;
MainLoop(zoom);
// Cleanup
delete cdt;
// Free points
for(int i = 0; i < polylines.size(); i++) {
vector<Point*> poly = polylines[i];
FreeClear(poly);
}
ShutDown(0);
return 0;
}