diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index 85204ad5d..8c75ed848 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -39,6 +39,7 @@ FGViewer::FGViewer( void ): view_offset(0.0), goal_view_offset(0.0) { + sgSetVec3( pilot_offset, 0.0, 0.0, 0.0 ); } diff --git a/src/Objects/matlib.cxx b/src/Objects/matlib.cxx index 6bac2370b..55a6b25db 100644 --- a/src/Objects/matlib.cxx +++ b/src/Objects/matlib.cxx @@ -267,6 +267,13 @@ FGNewMat *FGMaterialLib::find( const string& material ) { // Destructor FGMaterialLib::~FGMaterialLib ( void ) { + // Free up all the material entries first + for ( material_map_iterator it = begin(); it != end(); it++ ) { + FGNewMat *slot = it->second; + if ( slot != NULL ) { + delete slot; + } + } }