1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

simplify CGuiHandler::handleEvents()

Threre is no need to allow (and I doubt is was in fact possible with old code) new events to arrive during processing events. Let them to be processed in next frame.
This commit is contained in:
AlexVinS 2014-06-18 08:30:23 +04:00
parent 5fdc63ab5b
commit c2dd696e96

View File

@ -169,19 +169,11 @@ void CGuiHandler::updateTime()
void CGuiHandler::handleEvents()
{
while(true)
boost::unique_lock<boost::mutex> lock(eventsM);
while(!events.empty())
{
SDL_Event ev;
boost::unique_lock<boost::mutex> lock(eventsM);
if(events.empty())
{
return;
}
else
{
ev = events.front();
events.pop();
}
SDL_Event ev = events.front();
events.pop();
this->handleEvent(&ev);
}
}