diff options
| author | Omar Rizwan <omar@omar.website> | 2023-10-13 20:18:49 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-10-13 20:18:49 +0000 |
| commit | 5fea5647e7f40c0f5cb99eccd7ab65319a9aa571 (patch) | |
| tree | 97116322bbefc1505d5cd3135521199cb31e205a /virtual-programs | |
| parent | image: WIP: Replace cache refcount with simpler LRU scheme (diff) | |
| download | folk-5fea5647e7f40c0f5cb99eccd7ab65319a9aa571.tar.gz folk-5fea5647e7f40c0f5cb99eccd7ab65319a9aa571.zip | |
image,Gpu: Fix cache, for the most part (was double-freeing)
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/display/image.folk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/virtual-programs/display/image.folk b/virtual-programs/display/image.folk index 91e571b9..28c66a3b 100644 --- a/virtual-programs/display/image.folk +++ b/virtual-programs/display/image.folk @@ -73,12 +73,14 @@ On process "display" { lappend numEvicted $im } } + foreach im $numEvicted { dict unset cache $im } # Evict old. dict for {im v} $cache { if {$numToEvict - [llength $numEvicted] == 0} { break } - Gpu::ImageManager::freeGpuImage $im + lassign $v gim + Gpu::ImageManager::freeGpuImage $gim lappend numEvicted $im } foreach im $numEvicted { dict unset cache $im } |
