CircularBuffer: use std::list for allocations instead of a vector.

This commit is contained in:
Dr. Chat
2016-04-09 21:40:18 -05:00
parent 4811ebc2ce
commit 2bd603bf18
2 changed files with 5 additions and 6 deletions

View File

@@ -211,10 +211,10 @@ void CircularBuffer::Flush(Allocation* allocation) {
}
void CircularBuffer::Clear() {
for (auto it = allocations_.begin(); it != allocations_.end();) {
delete *it;
it = allocations_.erase(it);
for (auto alloc : allocations_) {
delete alloc;
}
allocations_.clear();
write_head_ = read_head_ = 0;
}