Alex Romosan <[EMAIL PROTECTED]> writes:
> it's happened with all the jsb aircraft i've tried so far (including
> the F80 dave culp just announced). i noticed this at sfo but i just
> tried a few random airports and the same thing happens. it does not
> happen with yasim planes. again, my jsb fdm has the carrier patch
> applied.
sorry about the noise, it turns out i had two
delete GroundCallback;
in FGFDMExec::DeAllocate(void) (in src/FDM/JSBSim/FGFDMExec.cpp). it's
probably an artifact of the carrier patch. that aside, i guess it
would make sense to set the pointers to zero right after we delete
them so things like this won't happen again.
looking at FGFDMExec::DeAllocate(void) it also looks like there are
some pointers we are deleting without setting them to zero (even
later) (GroundCallback being one of them). maybe we can apply
something like this:
Index: src/FDM/JSBSim/FGFDMExec.cpp
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/FDM/JSBSim/FGFDMExec.cpp,v
retrieving revision 1.14
diff -u -r1.14 FGFDMExec.cpp
--- src/FDM/JSBSim/FGFDMExec.cpp 11 Jun 2005 08:19:16 -0000 1.14
+++ src/FDM/JSBSim/FGFDMExec.cpp 20 Dec 2005 08:18:32 -0000
@@ -271,40 +271,27 @@
bool FGFDMExec::DeAllocate(void)
{
- delete Atmosphere;
- delete FCS;
- delete Propulsion;
- delete MassBalance;
- delete Aerodynamics;
- delete Inertial;
- delete GroundReactions;
- delete Aircraft;
- delete Propagate;
- delete Auxiliary;
- delete Output;
- delete State;
+ delete Atmosphere; Atmosphere=0;
+ delete FCS; FCS=0;
+ delete Propulsion; Propulsion=0;
+ delete MassBalance; MassBalance=0;
+ delete Aerodynamics; Aerodynamics=0;
+ delete Inertial; Inertial=0;
+ delete GroundReactions; GroundReactions=0;
+ delete Aircraft; Aircraft=0;
+ delete Propagate; Propagate=0;
+ delete Auxiliary; Auxiliary=0;
+ delete Output; Output=0;
+ delete State; State=0;
- delete IC;
- delete Trim;
+ delete IC; IC=0;
+ delete Trim; Trim=0;
- delete GroundCallback;
+ delete GroundCallback; GroundCallback=0;
FirstModel = 0L;
Error = 0;
- State = 0;
- Atmosphere = 0;
- FCS = 0;
- Propulsion = 0;
- MassBalance = 0;
- Aerodynamics = 0;
- Inertial = 0;
- GroundReactions = 0;
- Aircraft = 0;
- Propagate = 0;
- Auxiliary = 0;
- Output = 0;
-
modelLoaded = false;
return modelLoaded;
}
--alex--
--
| I believe the moment is at hand when, by a paranoiac and active |
| advance of the mind, it will be possible (simultaneously with |
| automatism and other passive states) to systematize confusion |
| and thus to help to discredit completely the world of reality. |
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d