diff --git a/src/osgPlugins/jp2/ReaderWriterJP2.cpp b/src/osgPlugins/jp2/ReaderWriterJP2.cpp index 27cd58f90..b57aa5cf1 100644 --- a/src/osgPlugins/jp2/ReaderWriterJP2.cpp +++ b/src/osgPlugins/jp2/ReaderWriterJP2.cpp @@ -176,7 +176,7 @@ class ReaderWriterJP2 : public osgDB::ReaderWriter { supportsExtension("jp2","Jpeg2000 image format"); supportsExtension("jpc","Jpeg2000 image format"); - + // little dance here to get around warnings created by jas_image_strtofmt use of char* rather than const char* // as a parameted and modern compilers deprecating "jp2" string being treated as char*. jas_init();//jas_image_strtofmt() bound to return -1 if jas_init has not been called. @@ -186,8 +186,13 @@ class ReaderWriterJP2 : public osgDB::ReaderWriter jas_image_clearfmts(); } + ~ReaderWriterJP2() + { + jas_cleanup(); + } + virtual const char* className() const { return "RGB Image Reader/Writer"; } - + virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* options) const { return readImage(file,options);