Integration between UIKit and cocos2d-x: Bug and video: -- SOLVED --

Here’s a video of the bug: http://youtu.be/EIvf-Ao6u5I
Because of this bug integration between UIKit and Cocos2d-x is practically impossible. After some switching between UIKit and cocos’ views the application will stop rendering opengl calls.

I found the reason. EAGLView is never released and this causes a leak of resources. To resolve the bug in JPSARDA’s example it is sufficient to add the following line:

[[EAGLView sharedEGLView] release];

at the end of CCEGELView::release method. This will solve JPSARDA’s ( and my application :smiley: ) issues but it is likely that this solution won’t work in projects that handle EAGLView’s lifecycle in a different way.

Cheers,
register.

P.S: In my opinion EAGLView should not be esposed as a singleton. Instead using EAGLView instances will prevent bugs like this one.