mirror of https://github.com/axmolengine/axmol.git
add term logic of application to prevent memory leak (for desktop such as linux, mac, windows)
This commit is contained in:
parent
a2dee37b0e
commit
768828ec29
|
@ -60,7 +60,13 @@ int Application::run()
|
|||
usleep((_animationInterval - iCurTime+iLastTime)*1000);
|
||||
}
|
||||
}
|
||||
|
||||
/* Only work on Desktop
|
||||
* Director::mainLoop is really one frame logic
|
||||
* when we want to close the window, we should call Director::end();
|
||||
* then call Director::mainLoop to do release of internal resources
|
||||
*/
|
||||
Director::getInstance()->end();
|
||||
Director::getInstance()->mainLoop();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,14 @@ int Application::run()
|
|||
Director::getInstance()->mainLoop();
|
||||
pMainWnd->pollEvents();
|
||||
}
|
||||
|
||||
/* Only work on Desktop
|
||||
* Director::mainLoop is really one frame logic
|
||||
* when we want to close the window, we should call Director::end();
|
||||
* then call Director::mainLoop to do release of internal resources
|
||||
*/
|
||||
Director::getInstance()->end();
|
||||
Director::getInstance()->mainLoop();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,13 @@ int Application::run()
|
|||
}
|
||||
}
|
||||
|
||||
/* Only work on Desktop
|
||||
* Director::mainLoop is really one frame logic
|
||||
* when we want to close the window, we should call Director::end();
|
||||
* then call Director::mainLoop to do release of internal resources
|
||||
*/
|
||||
Director::getInstance()->end();
|
||||
Director::getInstance()->mainLoop();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue