From: Mathias Froehlich Date: Sun, 30 Oct 2011 09:31:41 +0000 (+0100) Subject: Fix returning reference to temporary. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2a4657c6093a6590b94fc0a772e2999590a5b04a;p=flightgear.git Fix returning reference to temporary. --- diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index c4bb125a7..bf302987c 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -380,7 +380,7 @@ FGGlobals::get_aircraft_position() const throw sg_exception("Can't get aircraft position", "FGGlobals::get_aircraft_position()" ); } -const SGVec3d& +SGVec3d FGGlobals::get_aircraft_positon_cart() const { return SGVec3d::fromGeod(get_aircraft_position()); diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index 365ce3988..52df7f514 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -267,7 +267,7 @@ public: const SGGeod & get_aircraft_position() const; - const SGVec3d& get_aircraft_positon_cart() const; + SGVec3d get_aircraft_positon_cart() const; inline FGModelMgr *get_model_mgr () { return model_mgr; }