Advanced Question When do meshes created by oapiLoadMeshGlobal destroyed?

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
11,318
Reaction score
2,786
Points
203
Location
between the planets
Well, that's pretty much the question. I seem to have some randomly occuring trouble (though seemingly only in debug mode), usually happens when loading a new scenario after exiting another one. I realized that I have no idea when or even if the meshes created by oapiLoadMeshGloabal get destroyed, or if I'm supposed to do it myself?
 
Well the manual says :

oapiLoadMeshGlobal()

Once a mesh is globally loaded it remains in memory until the user closes the simulation window.

I think you can also register a callback to get notified when a mesh is destroyed, so then you will know :

OAPIFUNC const MESHHANDLE oapiLoadMeshGlobal ( const char * fname,
LoadMeshClbkFunc fClbk
)
 
Thanks. The calback actually gets called right after mesh creation, not after destruction.
So, I can assume that these meshes are destroyed after all vessel destructors have been executed. Hmmmm....
 
Back
Top