/*terminate the processor so cancel it*/ void ProcessorHandler( int _numSig) { /*need destroy everything... item struct in both Hash */ DataBaseDestroy( GetPtrDataBaseObi()); DataBaseDestroy( GetPtrDataBaseSbi()); GraphDestroy(GetPtrGraph()); if (0 != pthread_cancel( GetProcThreadID() ) ) { return; } if (0 != pthread_kill( GetProcThreadID(), SIGINT)) { return; } }
//////////////////////////////////////////////////////////// /// Destroy the application //////////////////////////////////////////////////////////// bool ApplicationDestroy() { // Destroy console ConsoleDestroy(); // Destroy protocol ProtocolDestroy(); // Initialize database if (!DataBaseDestroy()) return false; return true; }