> No, the JSBSim object is created on the heap memory - not on 
> the stack. Only local variables (including local static 
> objects) are on the stack. Heap isn't initialized, neither 
> stack. So member variables have random values - unless 
> explicitly set. Most compilers provide warnings for 
> uninitialized local variables (on the stack), but 
> unfortunately I don't know any compiler (yet) producing 
> warning for uninitialized member variables.

[First: Guys, can you trim quotes, please? And the use of HTML is a pain in
email.]

>From a JSBSim perspective, we are very careful about using variables before
they are set/initialized. We have gotten reports from multiple user
communities over years, and this is something that has been addressed
continuously.

I'd like to find a way to reinitialize an instance of JSBSim in FlightGear
without having to destruct it and reinstantiate it. A couple of years ago I
changed the construction process and separated out a reset/reinitialization
feature to permit a sim to be reset, bypassing the loading of aircraft
models. That saved a lot of time. I think that process should be looked at
for resetting JSBSim in FlightGear, too.

It's possible that some newer feature is causing a problem due to an
uninitialized variable that has been so far overlooked, but I expect the
problem lies in a different area. I think it points out that we should have
more error checking, though, so the problem is more gracefully handled and
the user informed.

Jon



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to