X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcachebase.C;h=690129603258dbaf37bfa5495cd89d42089251fe;hb=579c1a612dbb807fadfaa1100e461e14de220cbb;hp=40b1e1bf8d08b22dadac577f04ba56b8203891dc;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/cachebase.C b/cinelerra-5.1/cinelerra/cachebase.C index 40b1e1bf..69012960 100644 --- a/cinelerra-5.1/cinelerra/cachebase.C +++ b/cinelerra-5.1/cinelerra/cachebase.C @@ -88,20 +88,26 @@ void CacheBase::remove_all() } -void CacheBase::remove_asset(Asset *asset) +void CacheBase::remove_item(int source_id, char *path) { CacheItemBase *current, *next; lock->lock("CacheBase::remove_id"); for( current=first; current; current=next ) { next = current->next; - if( (current->path && !strcmp(current->path, asset->path)) || - current->source_id == asset->id) + if( current->source_id == source_id || + (path && current->path && !strcmp(current->path, path)) ) del_item(current); } lock->unlock(); -//printf("CacheBase::remove_asset: removed %d entries for %s\n", total, asset->path); } - +void CacheBase::remove_item(Indexable *idxbl) +{ + remove_item(idxbl->id, idxbl->path); +} +void CacheBase::remove_asset(Asset *asset) +{ + remove_item(asset); +} void CacheBase::del_item(CacheItemBase *item) {