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:
minggo 2013-09-18 02:44:34 -07:00
commit ff3fcf5eb7
35 changed files with 87 additions and 66 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();