Skip to content
Snippets Groups Projects
Commit ee0d2c12 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: free ossim memory

parent f9643cf4
Branches
Tags
No related merge requests found
......@@ -33,6 +33,11 @@ DEMHandler
{
}
DEMHandler
::~DEMHandler()
{
}
void
DEMHandler
::OpenDEMDirectory(const char* DEMDirectory)
......@@ -54,13 +59,21 @@ void
DEMHandler
::OpenGeoidFile(const char* geoidFile)
{
ossimFilename geoid(geoidFile);
ossimGeoid* geoidPtr = new ossimGeoidEgm96(geoid);
if (geoidPtr->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
if ((ossimGeoidManager::instance()->findGeoidByShortName("geoid1996")) == 0)
{
m_Mutex.Lock();
ossimGeoidManager::instance()->addGeoid(geoidPtr);
m_Mutex.Unlock();
otbMsgDevMacro( << "Opening geoid: " << geoidFile);
ossimFilename geoid(geoidFile);
ossimGeoid* geoidPtr = new ossimGeoidEgm96(geoid);
if (geoidPtr->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
{
m_Mutex.Lock();
ossimGeoidManager::instance()->addGeoid(geoidPtr);
m_Mutex.Unlock();
}
else
{
delete geoidPtr;
}
}
}
......
......@@ -74,7 +74,7 @@ public :
protected:
DEMHandler();
~DEMHandler(){};
~DEMHandler();
void PrintSelf(std::ostream& os, itk::Indent indent) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment