pgraph: fix freeze in garbage_collect(), esp. when rate-limit is on

This commit is contained in:
rdb 2018-10-17 19:09:36 +02:00
parent 6488e46cc7
commit 775e4cecff
3 changed files with 10 additions and 1 deletions

View File

@ -211,7 +211,7 @@ garbage_collect() {
}
num_this_pass = std::min(num_this_pass, size);
size_t stop_at_element = (_garbage_index + num_this_pass) % size;
size_t stop_at_element = (si + num_this_pass) % size;
do {
RenderAttrib *attrib = (RenderAttrib *)_attribs->get_key(si);
@ -229,6 +229,9 @@ garbage_collect() {
// still need to visit.
--size;
--si;
if (stop_at_element > 0) {
--stop_at_element;
}
}
si = (si + 1) % size;

View File

@ -950,6 +950,9 @@ garbage_collect() {
// still need to visit.
--size;
--si;
if (stop_at_element > 0) {
--stop_at_element;
}
}
si = (si + 1) % size;

View File

@ -1216,6 +1216,9 @@ garbage_collect() {
// still need to visit.
--size;
--si;
if (stop_at_element > 0) {
--stop_at_element;
}
}
si = (si + 1) % size;