Vash
OHM Administrator
- Joined
- Mar 26, 2008
- Messages
- 189
- Reaction score
- 2
- Points
- 0
- Location
- In a cave, of course.
- Website
- www.orbithangar.com
Maybe it's just me, but as far as I can tell, my vessel's destructor is never being called. The reason why I say this is that I have allocated a few texture resources using oapiLoadTexture. If I change those textures in my vessel dll and completely restart orbiter, the old textures still load in-game. It is not until several more loads/unloads that the new textures finally appear. I have the following code in my vessel class:
With the messagebox code there, the messagebox never appears. I have also tried compiling a debug version and debugging it while running. I can set breakpoints in the main code and they get hit just fine, but if I put a breakpoint in the ovcExit and/or destructor, it never gets hit!
All I am doing is starting orbiter, loading a scenario with only my vessel in it, and then ctrl+q, and then exiting the program completely. During all of this (as far as I can tell), the destructor is never called! Am I missing something here?
And yes, I do have the destructor defined in the public section of my class definition. Any ideas?
EDIT: I may have been doing something funny with my compiling and such (it's getting late over here). But I am still clueless on why a breakpoint in the destructor always fails to be hit.
Code:
Rifter::~Rifter(){
MessageBox(0,"test","test",0);
oapiDestroySurface(drawExhaust);
oapiDestroySurface(exh1);
oapiDestroySurface(exh2);
}
DLLCLBK void ovcExit (VESSEL *vessel)
{
if (vessel) delete (Rifter*)vessel;
}
All I am doing is starting orbiter, loading a scenario with only my vessel in it, and then ctrl+q, and then exiting the program completely. During all of this (as far as I can tell), the destructor is never called! Am I missing something here?
And yes, I do have the destructor defined in the public section of my class definition. Any ideas?
EDIT: I may have been doing something funny with my compiling and such (it's getting late over here). But I am still clueless on why a breakpoint in the destructor always fails to be hit.