diff --git a/src/core/manager.c b/src/core/manager.c index 4f6232e8ad..ebad062bd3 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1367,7 +1367,6 @@ good: static unsigned manager_dispatch_gc_unit_queue(Manager *m) { unsigned n = 0, gc_marker; - Unit *u; assert(m); @@ -1379,11 +1378,13 @@ static unsigned manager_dispatch_gc_unit_queue(Manager *m) { gc_marker = m->gc_marker; - while ((u = LIST_POP(gc_queue, m->gc_unit_queue))) { + Unit *u; + while ((u = m->gc_unit_queue)) { assert(u->in_gc_queue); unit_gc_sweep(u, gc_marker); + LIST_REMOVE(gc_queue, m->gc_unit_queue, u); u->in_gc_queue = false; n++;