Advanced Question When do meshes created by oapiLoadMeshGlobal destroyed?

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
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?
 

dumbo2007

Crazy about real time sims
Joined
Nov 29, 2009
Messages
675
Reaction score
0
Points
0
Location
India
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
)
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
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....
 
Top