[client] prevent 100% CPU usage in event loop, fixes #41

This commit is contained in:
Geoffrey McRae 2018-01-29 16:56:23 +11:00
parent 9aba969296
commit 2af522aea7

View File

@ -923,12 +923,15 @@ int run()
{ {
SDL_Event event; SDL_Event event;
while(SDL_PollEvent(&event)) while(SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT) if (event.type == SDL_QUIT)
{ {
if (!params.ignoreQuit) if (!params.ignoreQuit)
state.running = false; state.running = false;
break; break;
} }
usleep(1000);
}
} }
break; break;