Improving core cleanup

parent 81dded4e
......@@ -45,14 +45,21 @@ void StopServer()
{
try
{
if( pServerCoreEventHandler )
pCore->DetachEventHandler( pServerCoreEventHandler );
if( pServer )
{
delete pServer;
pServer = nullptr;
}
if( pCore )
{
pCore->Finalize();
delete pCore;
delete pCore;
pCore = nullptr;
}
}
catch( CVAException& e )
{
......@@ -82,8 +89,13 @@ class CServerCoreEventHandler : public IVAEventHandler
public:
inline void HandleVAEvent( const CVAEvent* pEvent )
{
if( pEvent->iEventType == CVAEvent::DESTROY )
StopServer();
if( pEvent->iEventType == CVAEvent::SHOTDOWN_REQUEST )
{
raise( SIGINT );
//StopServer();
cout << "Closing server application after remote shutdown request" << endl;
exit( 0 );
}
};
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment