File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ bool DecompressSchedulerExcalibur::scheduleT1(ITileProcessor* tileProcessor)
148148 continue ;
149149
150150 auto cblk = precinct->getDecompressBlock (cblkno);
151- auto block = new t1::DecompressBlockExec (cacheAll);
151+ auto block = std::make_shared< t1::DecompressBlockExec> (cacheAll);
152152 block->x = cblk->x0 ();
153153 block->y = cblk->y0 ();
154154 // block->postProcessor_ =
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ struct IOpenable
2424{
2525 virtual ~IOpenable () = default ;
2626 virtual void open () = 0;
27+ virtual void close () = 0;
2728};
2829
2930} // namespace exc
Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ struct DecompressBlockExec : public BlockExec
7676 if (open_)
7777 open_ ();
7878 }
79+ void close (void ) override
80+ {
81+ delete cachedCoder_;
82+ cachedCoder_ = nullptr ;
83+ if (cblk)
84+ cblk->release ();
85+ }
7986 bool open (ICoder* coder) override
8087 {
8188 auto activeCoder = cachedCoder_ ? cachedCoder_ : coder;
@@ -120,18 +127,17 @@ struct DecompressBlockExec : public BlockExec
120127};
121128struct CompressBlockExec : public BlockExec
122129{
123- using IOpenable::open;
124-
125130 CompressBlockExec () = default ;
126131 ~CompressBlockExec () override = default ;
127132
128133 void open (void ) override {}
134+ void close (void ) override {}
129135
130136 bool open (ICoder* coder) override
131137 {
132138 return coder->compress (this );
133139 }
134- void close ( void ) {}
140+
135141 CodeblockCompress* cblk = nullptr ;
136142 uint32_t tile_width = 0 ;
137143 bool doRateControl = false ;
You can’t perform that action at this time.
0 commit comments