Commit 0357ed3a authored by Kamil Iskra's avatar Kamil Iskra

Fix issue #1

Correctly deal with the case of the last container of the vector being
deleted.
parent 0f4ed2b5
...@@ -579,6 +579,7 @@ void Container_manager::delete_container(string command) ...@@ -579,6 +579,7 @@ void Container_manager::delete_container(string command)
sleep(1); sleep(1);
cc->remove(); cc->remove();
bool deleted = false;
vector<Argo_container*>::iterator it; vector<Argo_container*>::iterator it;
for(it = _containers.begin(); it != _containers.end(); it++) for(it = _containers.begin(); it != _containers.end(); it++)
{ {
...@@ -589,10 +590,11 @@ void Container_manager::delete_container(string command) ...@@ -589,10 +590,11 @@ void Container_manager::delete_container(string command)
_logger->log(LOG_TYPE_INFO, "Container " + cc->get_name() _logger->log(LOG_TYPE_INFO, "Container " + cc->get_name()
+ " deleted."); + " deleted.");
delete cc; delete cc;
deleted = true;
break; break;
} }
} }
assert(_containers.empty() || it != _containers.end()); assert(deleted);
} }
void Container_manager::alter_container(string command) void Container_manager::alter_container(string command)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment