- Joined
- Aug 6, 2011
- Messages
- 405
- Reaction score
- 2
- Points
- 18
More catch-ctd questions...
Is there a difference in how Orbiter deals with modules when you uncheck them in Orbiter versus on Orbiter exit?
I have the following module proxy class:
It looks pretty simple....
I hook oapiRegisterModule to do this:
Where lastLoadedDLL is an HINSTANCE set by my hook in LoadLibraryA.
I'm having an issue with Orbiter crashing on exit, but not on unchecking a module.
Normally, ModuleProxy would forward on calls to the "actualModule" pointer, but I removed all that code, and it still crashes.
In this case, ModuleProxy is just being a container for the real module.
Using Rcontrol as my test module (the only built-in Orbiter plugin that uses the non-deprecated module system), everything happily works. Checking Rcontrol calls my ModuleProxy constructor, and unchecking Rcontrol calls my ModuleProxy deconstructor, which destroys the "real" Rcontrol.
However, exiting out of the launchpad with Rcontrol still checked, Orbiter crashes with an access violation. My deconstructor is never called in this case.
---------- Post added at 12:32 PM ---------- Previous post was at 12:17 PM ----------
Ok, I rebuilt Rcontrol from the samples, so I would have debug symbols.
The same access violation occurs on exit, but the crash isn't occurring inside Rcontrol, as it just breaks into assembly.
Is there a difference in how Orbiter deals with modules when you uncheck them in Orbiter versus on Orbiter exit?
I have the following module proxy class:
Code:
class ModuleProxy : public oapi::Module
{
public:
ModuleProxy(HINSTANCE hDLL, oapi::Module* pModule);
~ModuleProxy();
private:
oapi::Module* actualModule;
};
ModuleProxy::ModuleProxy(HINSTANCE hDLL, oapi::Module* pModule) : oapi::Module(hDLL)
{
actualModule = pModule;
}
ModuleProxy::~ModuleProxy()
{
delete actualModule;
}
I hook oapiRegisterModule to do this:
Code:
void MyRegisterModule(oapi::Module* module)
{
ModuleProxy* newModule = new ModuleProxy(lastLoadedDLL, module);
pRegisterModule(newModule);
}
I'm having an issue with Orbiter crashing on exit, but not on unchecking a module.
Normally, ModuleProxy would forward on calls to the "actualModule" pointer, but I removed all that code, and it still crashes.
In this case, ModuleProxy is just being a container for the real module.
Using Rcontrol as my test module (the only built-in Orbiter plugin that uses the non-deprecated module system), everything happily works. Checking Rcontrol calls my ModuleProxy constructor, and unchecking Rcontrol calls my ModuleProxy deconstructor, which destroys the "real" Rcontrol.
However, exiting out of the launchpad with Rcontrol still checked, Orbiter crashes with an access violation. My deconstructor is never called in this case.
---------- Post added at 12:32 PM ---------- Previous post was at 12:17 PM ----------
Ok, I rebuilt Rcontrol from the samples, so I would have debug symbols.
The same access violation occurs on exit, but the crash isn't occurring inside Rcontrol, as it just breaks into assembly.