From a2eb8977e064d6ccdceaba37ab21c1d8f3366089 Mon Sep 17 00:00:00 2001 From: Unai Orbe Date: Thu, 30 Oct 2014 11:18:10 +0000 Subject: [PATCH] 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. --- cocos/platform/ios/CCGLViewImpl-ios.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/platform/ios/CCGLViewImpl-ios.mm b/cocos/platform/ios/CCGLViewImpl-ios.mm index 022fd51d56..662568cee5 100644 --- a/cocos/platform/ios/CCGLViewImpl-ios.mm +++ b/cocos/platform/ios/CCGLViewImpl-ios.mm @@ -128,7 +128,7 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram sharegroup: nil multiSampling: NO numberOfSamples: 0]; - + [eaglview setMultipleTouchEnabled:YES]; _screenSize.width = _designResolutionSize.width = [eaglview getWidth]; @@ -182,12 +182,12 @@ float GLViewImpl::getContentScaleFactor() const void GLViewImpl::end() { [CCDirectorCaller destroy]; - + // destroy EAGLView CCEAGLView *eaglview = (CCEAGLView*) _eaglview; [eaglview removeFromSuperview]; - //[eaglview release]; + [eaglview release]; }