Skip to content

Commit

Permalink
protect initialization of LasReader stream from destruction (NITF dri…
Browse files Browse the repository at this point in the history
…ver interaction
  • Loading branch information
hobu committed Jun 11, 2015
1 parent 82a4ecb commit ea409a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions io/las/LasReader.cpp
Expand Up @@ -826,6 +826,7 @@ void LasReader::done(PointTableRef)
m_unzipper.reset();
#endif
destroyStream();
m_initialized = false;
}

} // namespace pdal
9 changes: 8 additions & 1 deletion io/las/LasReader.hpp
Expand Up @@ -88,7 +88,14 @@ class PDAL_DLL LasReader : public pdal::Reader
return m_istream;
}
virtual void destroyStream()
{ FileUtils::closeFile(m_istream); m_istream = NULL; m_initialized = false; }
{
if (m_istream && m_initialized)
{
FileUtils::closeFile(m_istream);
m_istream = NULL;
m_initialized = false;
}
}
private:
LasError m_error;
LasHeader m_lasHeader;
Expand Down

0 comments on commit ea409a7

Please sign in to comment.