From da33ab1cf899b718907883faf4d083981bc17056 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 12 Jun 2001 22:24:52 +0000 Subject: [PATCH] Oops, fixed a bug introduced in the previous round that munged many runway textures. --- src/Objects/matlib.cxx | 8 +++++++- src/Objects/newmat.cxx | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Objects/matlib.cxx b/src/Objects/matlib.cxx index 55a6b25db..6c8cf6b7f 100644 --- a/src/Objects/matlib.cxx +++ b/src/Objects/matlib.cxx @@ -130,8 +130,14 @@ bool FGMaterialLib::load( const string& mpath ) { in >> token; if ( token == '{' ) { + // Read the data into a temporary but stack allocated + // copy of the structure + FGNewMat tmp; + in >> tmp; + + // create a pointer to a heap allocated copy of the structure FGNewMat *m = new FGNewMat; - in >> *m; + *m = tmp; // build the ssgSimpleState SGPath tex_path( globals->get_fg_root() ); diff --git a/src/Objects/newmat.cxx b/src/Objects/newmat.cxx index 2fa702d61..1e917524d 100644 --- a/src/Objects/newmat.cxx +++ b/src/Objects/newmat.cxx @@ -200,7 +200,6 @@ void FGNewMat::dump_info () { FGNewMat::~FGNewMat ( void ) { } - istream& operator >> ( istream& in, FGNewMat& m ) { -- 2.39.2