On Tue, 11 Jun 2013, Alex Romosan wrote: > wouldn't it better to have something like this: > > FGPropertyManager pm = > FGPropertyManager((FGPropertyNode*)globals->get_props() ); > fdmex = new FGFDMExec(&pm); > > that way we don't leak an FGPropertyManager object on each reset. seems > to work for me.
That certainly does not look right. That way the FGPropertyManager instance is a local variable in the FGJSBsim object's constructor. Hence it's address ought to refer to stack memory that could (most likely will) be reused after the constructor has returned. Adding a FGPropertyManager member variable to the JSBSim class, on the other hand, may well be a solution. I do need to double check what JSBSim does with the property tree when the FGFDMExec object is deleted (as it is on each reset). Cheers, Anders -- --------------------------------------------------------------------------- Anders Gidenstam WWW: http://gitorious.org/anders-hangar http://www.gidenstam.org/FlightGear/ ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel