Uncomment eaglview release CCEAGLViewImpl-ios

This is leaking the eaglview when the Director is purged.

In our case, we are leaving the cocos environment on some views which
are implemented with cocoa, and because this eaglview is not being
released, it is getting notifications for keyboard events, and trying to
access stuff on the NULL eaglview, crashing our app.

Uncommnenting this line seems to fix the problem for us, and we haven't
been able to find any nasty side effects.
This commit is contained in:
Unai Orbe 2014-10-30 11:18:10 +00:00
parent e99ea7a9fe
commit a2eb8977e0
1 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram
sharegroup: nil sharegroup: nil
multiSampling: NO multiSampling: NO
numberOfSamples: 0]; numberOfSamples: 0];
[eaglview setMultipleTouchEnabled:YES]; [eaglview setMultipleTouchEnabled:YES];
_screenSize.width = _designResolutionSize.width = [eaglview getWidth]; _screenSize.width = _designResolutionSize.width = [eaglview getWidth];
@ -182,12 +182,12 @@ float GLViewImpl::getContentScaleFactor() const
void GLViewImpl::end() void GLViewImpl::end()
{ {
[CCDirectorCaller destroy]; [CCDirectorCaller destroy];
// destroy EAGLView // destroy EAGLView
CCEAGLView *eaglview = (CCEAGLView*) _eaglview; CCEAGLView *eaglview = (CCEAGLView*) _eaglview;
[eaglview removeFromSuperview]; [eaglview removeFromSuperview];
//[eaglview release]; [eaglview release];
} }