Possible serious bug in CCDirector::end or EAGLView.

Possible serious bug in CCDirector::end or EAGLView.
0.0 0


The bug can be reproduced using this example project http://dl.dropbox.com/u/12856650/Cocos2dxOnUikit.zip. This example is found in Jpsarda’s post about integration between UIKit and cocos2d-x at “http://jpsarda.tumblr.com/post/24983791554/mixing-cocos2d-x-uikit”.
To reproduce the bug keep on opening and closing the cocos2d view by pressing repeatedly the “Cocos2d-x GO!” button on the first view and the “Close” button on the second view. After many iterations the Cocos2d view will render only a black background. To me it happens after repeating the sequence 8 times. This behavior can be reproduced only on a real device and not on the simulator ( I am testing using an old 3G). I have debugged the code and the mainloop of CCDirector seems to run correctly. At the moment I am really clueless about how to fix it: it seems like there is some leaked resource that affects the opengl context.