On 8/12/07, Anders Gidenstam <[EMAIL PROTECTED]> wrote:
> On Wed, 8 Aug 2007, Stuart Buchanan wrote:
>
> > I'd be very grateful if you could help me diagnose the problem, as I did
> > quite a lot of testing, but didn't encounter this myself.
> >
> > One possibility is that my interpolation is "fighting" with something else
> > trying to write to the weather properties.
>
> Hi!
>
> With Stuart's help I've looked closer at this and I think I've tracked
> down the cause of the problem:
> At least on my computer the sort() call on line 234 in
> Environment/environment_ctrl.cxx sorts the vector entries by memory
> address instead of altitude, i.e. the custom comparison predicate is not
> used. This causes the tables of environment conditions to be reordered
> into a wrong order at some weather updates, depending, basically,
> on where the memory allocator places the objects. (Btw. why are they are
> freshly allocated for each update?)

That's because there is no custom comparison predicate for comparing
bucket*. vector<bucket*> is just a list of pointers, and so uses the
sort order for pointers. You'd have to set up an STL functor to sort
them, which is ugly and difficult (but certainly doable). If sorting
is unnecessary it's a better way to go, obviously. :-)

When I comment out the sort, it works well for me.

-- 
Hans Fugal
Fugal Computing

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to