Skip to content

Commit

Permalink
fix: Fix memory leak in SipiImage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Geer committed Jan 24, 2017
1 parent 2c32060 commit aadc63e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/SipiImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace Sipi {
friend class SipiIOJpeg; //!< I/O class for the JPEG file format
friend class SipiIOPng; //!< I/O class for the PNG file format
private:
static std::unordered_map<std::string,SipiIO*> io; //!< member variable holding a map of I/O class instances for the different file formats
static std::unordered_map<std::string, std::shared_ptr<SipiIO> > io; //!< member variable holding a map of I/O class instances for the different file formats
byte bilinn (byte buf[], register int nx, register float x, register float y, register int c, register int n);
word bilinn (word buf[], register int nx, register float x, register float y, register int c, register int n);
protected:
Expand Down
12 changes: 6 additions & 6 deletions src/SipiImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ static const char __file__[] = __FILE__;

namespace Sipi {

std::unordered_map<std::string,SipiIO*> SipiImage::io = {
{"tif", new SipiIOTiff()},
{"jpx", new SipiIOJ2k()},
//{"jpx", new SipiIOOpenJ2k()},
{"jpg", new SipiIOJpeg()},
{"png", new SipiIOPng()}
std::unordered_map<std::string, std::shared_ptr<SipiIO> > SipiImage::io = {
{"tif", std::make_shared<SipiIOTiff>()},
{"jpx", std::make_shared<SipiIOJ2k>()},
//{"jpx", std::make_shared<SipiIOOpenJ2k>()},
{"jpg", std::make_shared<SipiIOJpeg>()},
{"png", std::make_shared<SipiIOPng>()}
};

std::unordered_map<std::string, std::string> SipiImage::mimetypes = {
Expand Down

0 comments on commit aadc63e

Please sign in to comment.