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();
|
lastTime = getCurrentMillSecond();
|
||||||
|
|
||||||
// Poll event before mainloop
|
|
||||||
glview->pollEvents();
|
|
||||||
director->mainLoop();
|
director->mainLoop();
|
||||||
|
glview->pollEvents();
|
||||||
|
|
||||||
curTime = getCurrentMillSecond();
|
curTime = getCurrentMillSecond();
|
||||||
if (curTime - lastTime < _animationInterval)
|
if (curTime - lastTime < _animationInterval)
|
||||||
|
|
|
@ -82,9 +82,8 @@ int Application::run()
|
||||||
{
|
{
|
||||||
lastTime = getCurrentMillSecond();
|
lastTime = getCurrentMillSecond();
|
||||||
|
|
||||||
// Poll event before mainloop
|
|
||||||
glview->pollEvents();
|
|
||||||
director->mainLoop();
|
director->mainLoop();
|
||||||
|
glview->pollEvents();
|
||||||
|
|
||||||
curTime = getCurrentMillSecond();
|
curTime = getCurrentMillSecond();
|
||||||
if (curTime - lastTime < _animationInterval)
|
if (curTime - lastTime < _animationInterval)
|
||||||
|
|
|
@ -89,9 +89,8 @@ int Application::run()
|
||||||
{
|
{
|
||||||
nLast.QuadPart = nNow.QuadPart;
|
nLast.QuadPart = nNow.QuadPart;
|
||||||
|
|
||||||
// Poll event before mainloop
|
|
||||||
glview->pollEvents();
|
|
||||||
director->mainLoop();
|
director->mainLoop();
|
||||||
|
glview->pollEvents();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue