开发者

When to call glDeleteBuffers()

Currently, I have a native function set up that I'm calling during onDestroy() on the Java side. I'm calling free() on any native side pointers I have memory allocated for. If I also call glDeleteBuffers() in this function, I get a an error in logcat stating

call to OpenGL ES API with no current context (logged onc开发者_开发百科e per thread)

I gather I could interrupt the Back Button Press and handle things more gracefully, but in the case the app is killed another way, what is the best way to make sure I've freed the gl resources in a timely manner?


When the context is destroyed it frees all it's resources (textures, buffers etc.) so it is not necessary to delete them manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜