views:

66

answers:

1

I several views in an iPhone app which happen to use independent openGL contexts. They are not necessarily long-lived so they go away before the process does. And they have a couple textures in each.

Does -releaseing the EAGLContext cause all that GL state to get cleaned up for me? Or am I leaking textures etc by not finding a place to call glDeleteTextures from?

Thanks.

+1  A: 

All resources associated with a sharegroup are destroyed, when the last reference to that sharegroup is released (usually by destroying all of the shared contexts).

Do be careful: when you make a context current for a thread, that counts as a reference. A context will not be deleted until it is detached from all threads that it may have been bound to.

Frogblast
Thanks for the tip on making the context non-current.
quixoto