Skip to content

Commit

Permalink
Have IsisCameraModel use shared pointer.
Browse files Browse the repository at this point in the history
This way after a copy, the shared_ptr can work out who needs to delete.
  • Loading branch information
Zack Moratto committed Oct 10, 2010
1 parent 5d26fd0 commit ab1dd7b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/asp/IsisIO/IsisCameraModel.h
Expand Up @@ -32,10 +32,8 @@ namespace camera {
// Constructors / Destructors
//------------------------------------------------------------------
IsisCameraModel(std::string cube_filename) {
m_interface = asp::isis::IsisInterface::open( cube_filename );
}
virtual ~IsisCameraModel() {
delete m_interface;
m_interface =
boost::shared_ptr<asp::isis::IsisInterface>(asp::isis::IsisInterface::open( cube_filename ) );
}
virtual std::string type() const { return "Isis"; }

Expand Down Expand Up @@ -75,7 +73,7 @@ namespace camera {
return m_interface->serial_number(); }

protected:
asp::isis::IsisInterface* m_interface;
boost::shared_ptr<asp::isis::IsisInterface> m_interface;

friend std::ostream& operator<<( std::ostream&, IsisCameraModel const& );
};
Expand Down

0 comments on commit ab1dd7b

Please sign in to comment.