mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5815 from dumganhar/develop
Reverts changes in CCApplication.cpp/.mm, pollEvent must after main loop, otherwise, potential crash will happen.
This commit is contained in:
commit
7337f87cb7
|
@ -83,9 +83,8 @@ int Application::run()
|
|||
{
|
||||
lastTime = getCurrentMillSecond();
|
||||
|
||||
// Poll event before mainloop
|
||||
glview->pollEvents();
|
||||
director->mainLoop();
|
||||
glview->pollEvents();
|
||||
|
||||
curTime = getCurrentMillSecond();
|
||||
if (curTime - lastTime < _animationInterval)
|
||||
|
|
|
@ -82,10 +82,9 @@ int Application::run()
|
|||
{
|
||||
lastTime = getCurrentMillSecond();
|
||||
|
||||
// Poll event before mainloop
|
||||
glview->pollEvents();
|
||||
director->mainLoop();
|
||||
|
||||
glview->pollEvents();
|
||||
|
||||
curTime = getCurrentMillSecond();
|
||||
if (curTime - lastTime < _animationInterval)
|
||||
{
|
||||
|
|
|
@ -89,9 +89,8 @@ int Application::run()
|
|||
{
|
||||
nLast.QuadPart = nNow.QuadPart;
|
||||
|
||||
// Poll event before mainloop
|
||||
glview->pollEvents();
|
||||
director->mainLoop();
|
||||
glview->pollEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue