- WretchedMallard
- Posts: 5
- Joined:
Crash from NsUnregisterComponent before NsRegisterComponent
Hi,
We have found that if our application requests an exit before it has completely finished its initialization steps it can result in calls to NsUnregisterComponent being made before the corresponding NsRegisterComponent has been called which results in the application crashing.
While understandable that it is not valid to attempt to unregister a component that is not yet registered I am wondering if anyone can shed some light on what these functions are doing internally to result in a crash state?
We have found that if our application requests an exit before it has completely finished its initialization steps it can result in calls to NsUnregisterComponent being made before the corresponding NsRegisterComponent has been called which results in the application crashing.
While understandable that it is not valid to attempt to unregister a component that is not yet registered I am wondering if anyone can shed some light on what these functions are doing internally to result in a crash state?
Re: Crash from NsUnregisterComponent before NsRegisterComponent
Who is calling NsUnregisterComponent? Could you please paste a callstack? I assume this is 2.2, right?
- WretchedMallard
- Posts: 5
- Joined:
Re: Crash from NsUnregisterComponent before NsRegisterComponent
Yes this is version 2.2.
I was not able to yet produce a call stack, but in response to who is calling NsUnregisterComponent our application is calling this function directly to unregister some of our custom components. When running attached to steam the user can call 'stop' from the steam interface which initiates shutdown before our initialization has fully completed.
for example
However I will also not that I am no longer certain that this is the cause of our issue. In attempting to debug with a minimal example I was not able to produce this exact behavior so it is possible that the true error is from elsewhere in our application
I was not able to yet produce a call stack, but in response to who is calling NsUnregisterComponent our application is calling this function directly to unregister some of our custom components. When running attached to steam the user can call 'stop' from the steam interface which initiates shutdown before our initialization has fully completed.
for example
Code: Select all
#define NOESIS_GAME_COMPONENTS()\
COMPONENT(myComponent)\
//called as part of our initialization step, behind a loading screen
void Init()
{
#define COMPONENT(component) NsRegisterComponent<component>();
NOESIS_GAME_COMPONENTS()
#undef COMPONENT
}
//called as part of our shutdown stage
//in this case steam requested shutdown during initial loading screen,
//causing this call to happen before init()
void Deinit()
{
#define COMPONENT(component) NsUnregisterComponent<component>();
NOESIS_GAME_COMPONENTS()
#undef COMPONENT
}
Who is online
Users browsing this forum: Ahrefs [Bot] and 42 guests