mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-30 01:03:30 +01:00
fee datapoint memory at end of testbed example
This commit is contained in:
parent
6550d6703e
commit
d2469ed4ce
@ -77,6 +77,14 @@ bool draw_map = false;
|
|||||||
/// Create a random distribution of points?
|
/// Create a random distribution of points?
|
||||||
bool random_distribution = false;
|
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[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -199,7 +207,16 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
MainLoop(zoom);
|
MainLoop(zoom);
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
|
||||||
delete cdt;
|
delete cdt;
|
||||||
|
|
||||||
|
// Free points
|
||||||
|
for(int i = 0; i < polylines.size(); i++) {
|
||||||
|
vector<Point*> poly = polylines[i];
|
||||||
|
FreeClear(poly);
|
||||||
|
}
|
||||||
|
|
||||||
ShutDown(0);
|
ShutDown(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user