Update local poll() implementation.
[awesomized/libmemcached] / libtest / framework.cc
index f8bc78c916375b9cfc8019733b9cfc2a5c647ad9..546ccb37590034e50865a989f2d3d9929513f38a 100644 (file)
@@ -40,6 +40,7 @@
 #include <libtest/collection.h>
 #include <libtest/signal.h>
 
+#include <algorithm>
 #include <fnmatch.h>
 #include <iostream>
 
@@ -86,12 +87,8 @@ Framework::~Framework()
 
   delete _runner;
 
-  for (std::vector<Collection*>::iterator iter= _collection.begin();
-       iter != _collection.end();
-       ++iter)
-  {
-    delete *iter;
-  }
+  std::for_each(_collection.begin(), _collection.end(), DeleteFromVector());
+  _collection.clear();
 }
 
 bool Framework::match(const char* arg)