mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 22:17:11 -04:00
Fix memory issues in std::list
This commit is contained in:
parent
af2c29b812
commit
1d0a5fb11f
@ -289,11 +289,13 @@ private:
|
||||
tail = node->prev;
|
||||
}
|
||||
|
||||
auto next = node->next;
|
||||
|
||||
delete node;
|
||||
|
||||
--_size;
|
||||
|
||||
return iterator(node->next);
|
||||
return iterator(next);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -307,8 +309,7 @@ public:
|
||||
|
||||
iterator erase(iterator it, iterator last){
|
||||
while(it != last){
|
||||
erase_node(it.current);
|
||||
++it;
|
||||
it = erase_node(it.current);
|
||||
}
|
||||
|
||||
return last;
|
||||
@ -316,8 +317,7 @@ public:
|
||||
|
||||
iterator erase(const_iterator it, const_iterator last){
|
||||
while(it != last){
|
||||
erase_node(it.current);
|
||||
++it;
|
||||
it = erase_node(it.current);
|
||||
}
|
||||
|
||||
return iterator(last.current);
|
||||
|
Loading…
x
Reference in New Issue
Block a user