- total_lock->lock("CICache::remove_all");
- for(current=first; current; current=temp)
- {
- temp = NEXT;
-// Must not be checked out because we need the pointer to check back in.
-// Really need to give the user the CacheItem.
- if(!current->checked_out)
- {
-//printf("CICache::remove_all: %s\n", current->asset->path);
- remove_pointer(current);
- removed.append(current);
+ for(;;) {
+ total_lock->lock("CICache::remove_all");
+ CICacheItem *current = first;
+ while( current ) {
+ CICacheItem *next_item = current->next;
+ if( !current->checked_out ) {
+ remove_pointer(current);
+ removed.append(current);
+ }
+ current = next_item;