So far, it hasn't triggered any segfault, but I'm not yet convinced there
is no problem whatsoever.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
TestFileStoreState::coll_entry_t::~coll_entry_t()
{
- /*
if (m_objects.size() > 0) {
- for (set<hobject_t*>::iterator it = m_objects.begin();
- it != m_objects.end(); it++) {
- hobject_t *obj = *it;
+// for (set<hobject_t*>::iterator it = m_objects.begin();
+// it != m_objects.end(); it++) {
+ map<int, hobject_t*>::iterator it = m_objects.begin();
+ for (; it != m_objects.end(); it++) {
+ hobject_t *obj = it->second;
m_objects.erase(it);
if (obj) {
delete obj;
}
}
}
- */
}
hobject_t *TestFileStoreState::coll_entry_t::touch_obj(int id)
m_max_in_flight(0), m_in_flight(0), m_finished_lock("Finished Lock") {
m_store.reset(store);
}
- ~TestFileStoreState() { }
+ ~TestFileStoreState() {
+ map<int, coll_entry_t*>::iterator it = m_collections.begin();
+ for (; it != m_collections.end(); it++) {
+ if (it->second)
+ delete it->second;
+ m_collections.erase(it);
+ }
+ }
void init(int colls, int objs);
void init() {