Problem DetachChild() holding up Launchpad

dumbo2007

Crazy about real time sims
Joined
Nov 29, 2009
Messages
675
Reaction score
0
Points
0
Location
India
I am developing a plugin using the orbiter111105 beta. I create a vessel dynamically and attach another vessel to it.

The dynamically created vessel is the base and the attached vessel is a rover. When the simulation ends I detach the rover using DetachChild()

However DetachChild() never seems to return. I checked with the Visual studio debugger. It didnt happen in the Orbiter P1 release.

I have attached the the plugin module file which should reproduce this error. The dynamically created vessel is of class BulletBase whose code is in the zip too.

I wonder if any recent changes have been made to DetachChild().
 

Attachments

Last edited:
The vBulletBase doesn't point to a valid VESSEL3 interface of BulletBase class, because the vessel has been already deleted.
 
Thanks, is there anyway to check that a VESSEL pointer points to a valid VESSEL class using something like a assert().
 
Better than VESSEL3 class pointer would be keeping its OBJHANDLE. You could check whether it's still valid with oapiIsVessel(OBJHANDLE) function, or you could compare in Bump::clbkDeleteVessel(OBJHANDLE) callback method (of your module's class) if it hasn't been just deleted, and set a flag or put NULL in its OBJHANDLE which is saved in Bump class, if it has been deleted.
 
By the way, unrelated to this, but I ll avoid starting a new thread by asking here, is there any addon which can draw the longitude and latitude lines on the surface of a celestial body at the angular interval I specify ?

I am working on some terrain collisions and it involves terrain patches made between a range of longitudes and latitudes. Would be useful to be able to see the parallels on the surface. Orbiter's default planetarium displays do not have an option for it.
 
Back
Top