diff --git a/src/compiler.cpp b/src/compiler.cpp index 126f8a9d72..c61bd223ad 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -5554,10 +5554,8 @@ resetFrame(Context* c, Event* e) clearSites(c, el.value); } - for (Resource* r = c->acquiredResources; r;) { - Resource* next = r->nextAcquired; - clearSites(c, r->value); - r = next; + while (c->acquiredResources) { + clearSites(c, c->acquiredResources->value); } }