Jim Wilson writes: > Yes, right after the cloud layer changes went in it started. David > knows about it. Comment out the cloud layer config in > preferences.xml and the problem goes away (but you have no clouds). > It appears there's something that isn't getting cleaned up in the > simgear code.
David, I'm looking for help on this one since it's seems to be very much wrapped up in the property system and environment manager and cloud layers. This problem seems to be very complicated. On selecting reset from the menu ... In flightgear/gui/gui_local.cxx, line #74 there is a call to "globals->restoreInitialState();" At the start of the program we save a copy of the property tree. As part of restoring the initial state we copy back this saved property tree to the current/master property tree. Because of callbacks (functions tied to property reads and writes) there are various calls into the environment manager that are triggered which then trigger a rebuild of a cloud layer. In simgear/sky/cloud.cxx, line #146 there is a "delete layer_root;" This is failing on the second reinit. I think what is happening is that a first delete is succeeding, but delete doesn't change the value of the pointer so now it is pointing to freed memory. Then we come along and run this routine again and the delete bombs because ssg is flagging that we are trying to free already freed memory (deadbeef check.) If we change the value of layer_root to NULL after the delete, this problem seems to go away and the property tree restore finishes. However, this doesn't seem to make sense because rebuild() should always build the cloud layer and leave layer_root valid, and the constructor initializes it to NULL so I don't see how this can ever be getting stomped on, unless it is happening inadvertantly somewhere else in the code? Beyond this one problem I think there is definitely something still busted because after the property tree restore finishes, we still get a crash re-initing time in a completely non-sensical place (a malloc). Thus I think some code triggered by the property tree restore is stomping on memory and causing problems later. I'm guessing it must be related to the new cloud layer code because removing the cloud layers from preferences.xml *seems* to make the problem mostly go away. That's as far as I've gotten on this one ... there are a lot of layers to this onion. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel