Skip to content

Commit bbe7eec

Browse files
author
Grok Compression
committed
TileProcessor: fine tune release based on cache strategy
1 parent 62c80b4 commit bbe7eec

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

src/lib/core/tile_processor/TileProcessor.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -896,15 +896,9 @@ void TileProcessor::release(uint32_t strategy)
896896
if((strategy & GRK_TILE_CACHE_ALL) == GRK_TILE_CACHE_ALL)
897897
return;
898898

899-
// LRU strategy: release decompressed data but keep processor alive
900-
// for re-decompression from cached compressed data
901-
if(strategy & GRK_TILE_CACHE_LRU)
902-
{
903-
delete tile_;
904-
tile_ = nullptr;
905-
// Keep image_ and tilePartFetchSeq_ for re-decompression
906-
return;
907-
}
899+
// delete tile components
900+
delete tile_;
901+
tile_ = nullptr;
908902

909903
// delete image in absence of tile cache strategy
910904
if(strategy == GRK_TILE_CACHE_NONE)
@@ -913,11 +907,7 @@ void TileProcessor::release(uint32_t strategy)
913907
image_ = nullptr;
914908
}
915909

916-
// delete tile components
917-
delete tile_;
918-
tile_ = nullptr;
919-
920-
if(tilePartFetchSeq_ && strategy != GRK_TILE_CACHE_ALL)
910+
if(tilePartFetchSeq_ && !(strategy & GRK_TILE_CACHE_LRU))
921911
{
922912
for(const auto& tpfs : *tilePartFetchSeq_)
923913
{

0 commit comments

Comments
 (0)