This commit is contained in:
xiongziliang 2018-02-24 15:18:16 +08:00
parent 15f03476c3
commit fe4da29fb1
6 changed files with 54 additions and 50 deletions

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[]){
return 0; return 0;
} }
{
list<MediaPlayer::Ptr> playerList; list<MediaPlayer::Ptr> playerList;
auto playerCnt = atoi(argv[1]);//启动的播放器个数 auto playerCnt = atoi(argv[1]);//启动的播放器个数
atomic_int alivePlayerCnt(0); atomic_int alivePlayerCnt(0);
@ -85,13 +85,14 @@ int main(int argc, char *argv[]){
return true; return true;
}); });
EventPoller::Instance().runLoop(); EventPoller::Instance().runLoop();
playerList.clear(); AsyncTaskThread::Instance().CancelTask(0);
}
static onceToken token(nullptr, []() { static onceToken token(nullptr, []() {
WorkThreadPool::Instance(); WorkThreadPool::Instance();
UDPServer::Destory(); UDPServer::Destory();
AsyncTaskThread::Destory();
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
}); });
return 0; return 0;

View File

@ -150,6 +150,7 @@ int main(int argc,char *argv[]){
requesterPost.reset(); requesterPost.reset();
//程序开始退出 //程序开始退出
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
return 0; return 0;
} }

View File

@ -89,8 +89,8 @@ int main(int argc, char *argv[]){
static onceToken token(nullptr, []() { static onceToken token(nullptr, []() {
UDPServer::Destory(); UDPServer::Destory();
AsyncTaskThread::Destory();
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
}); });
return 0; return 0;

View File

@ -114,6 +114,7 @@ int domain(int argc, const char *argv[]) {
//清理程序 //清理程序
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
return 0; return 0;
} }

View File

@ -121,6 +121,7 @@ int domain(int argc,const char *argv[]){
//程序清理 //程序清理
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
return 0; return 0;
} }

View File

@ -250,8 +250,8 @@ int main(int argc,char *argv[]) {
UDPServer::Destory(); UDPServer::Destory();
//TcpServer用到了WorkThreadPool //TcpServer用到了WorkThreadPool
WorkThreadPool::Destory(); WorkThreadPool::Destory();
AsyncTaskThread::Destory();
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
return 0; return 0;
} }