SmtThreadPool::~SmtThreadPool() { TerminateAll(); for(int i=0;i < m_vThreads.size();i++) { SmtWorkThread* pThread = m_vThreads[i]; SMT_SAFE_DELETE(pThread); } m_vThreads.clear(); m_vIdleThreads.clear(); m_vBusyThreads.clear(); }
//--------------------------------------------------------------------------- void TCustomMsgServer::Stop() { if (Status == SrvRunning) { // Kills the listener thread ServerThread->Terminate(); if (ServerThread->WaitFor(ThTimeout) != WAIT_OBJECT_0) ServerThread->Kill(); delete ServerThread; // Kills the listener delete SockListener; // Terminate all client threads TerminateAll(); Status = SrvStopped; LocalBind = 0; DoEvent(0, evcServerStopped, 0, 0, 0, 0, 0); }; FLastError = 0; }
CThreadPool::~CThreadPool() { TerminateAll(); }