mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
add exit event
This commit is contained in:
parent
91adaaaab6
commit
9d43c38e09
@ -71,20 +71,26 @@ public:
|
||||
SDL_Event event;
|
||||
while(flag){
|
||||
SDL_WaitEvent(&event);
|
||||
if (event.type == REFRESH_EVENT)
|
||||
{
|
||||
{
|
||||
lock_guard<mutex> lck(_mtxTask);
|
||||
if(_taskList.empty()){
|
||||
//not reachable
|
||||
continue;
|
||||
}
|
||||
task = _taskList.front();
|
||||
_taskList.pop_front();
|
||||
}
|
||||
flag = task();
|
||||
}
|
||||
|
||||
switch (event.type){
|
||||
case REFRESH_EVENT:{
|
||||
{
|
||||
lock_guard<mutex> lck(_mtxTask);
|
||||
if(_taskList.empty()){
|
||||
//not reachable
|
||||
continue;
|
||||
}
|
||||
task = _taskList.front();
|
||||
_taskList.pop_front();
|
||||
}
|
||||
flag = task();
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
InfoL << event.type;
|
||||
return;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user