Added desctructor with jas_cleanup().

This commit is contained in:
Robert Osfield
2010-01-11 16:03:13 +00:00
parent 5dad3a0afb
commit 5288f380c6

View File

@@ -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);