mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3690 from dabingnn/release30_bug_hot_fix
glfw EGLView alloc on the stack to prevent memory leak
This commit is contained in:
commit
ff3fcf5eb7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,14 @@ int Application::run()
|
|||
Sleep(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",960,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",960,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ USING_NS_CC;
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
|
@ -24,8 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
EGLView eglView;
|
||||
eglView.init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
Loading…
Reference in New Issue