"Frederic Bouvier" writes: > Curtis L. Olson wrote: >
> > As I understand it, the deadbeef thing is something ssg writes into > > memory that it frees. Later if you try to traverse something that is > > marked as deadbeef, you know you have a pointer to deallocated memory. > > This is typically what triggers the deadbeef assertion. > > > > My guess (and this is a guess) is that the ai system is loading a single > > model of an aircraft and using it in multiple places. Then, if for > > some reason all the aircraft of a certain type fly out of range and we > > remove them from the tree, ssg could try to free the model itself if the > > last reference to it is removed. > > > > But, if the ai system doesn't account for this and later tries to use > > that same model pointer, you will get the deadbeef error (notice > > deadbeef is a hexidecimal number). > > > > What you do to work around this problem is to ref() the model once when > > you load it, then you can add and remove it from the scene graph as much > > as you like, delete the parent of the model, etc. etc. and the number of > > references will never drop below one, so the model itself will never be > > deleted. > > > > That's pure speculation though based only on the crash appearing to > > happen in the AI system. > > Indeed, I don't see _defaultModel->ref(); or _piperModel->ref(); in > AIMgr.cxx > ref() is in AIEntity::SetModel, and deref() is in AIEntity dtor. I guess this is definately something that I've screwed up somewhere though :-( Cheers - Dave _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel