Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7002769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:58:18+00:00 2026-05-27T20:58:18+00:00

Question: Considering the hello-gl2 example from Android NDK r6b, is this example correct when

  • 0

Question:

Considering the hello-gl2 example from Android NDK r6b, is this example correct when user repeatedly invokes pause/resume actions of the GLSurfaceView? I’m asking because each time a GL2JNIView.Renderer.onSurfaceChanged() is called, it creates all OpenGL resources (shaders, textures) but it never destroys them.

Background:

I’m trying to debug some OpenGL ES 2.0 game implemented using C++ and JNI which behaves incorrectly during pause/resume. I was trying to find some reference example for this but I haven’t found any except of the mentioned hello2-gl example from NDK, which may IMHO create memory leaks, and this more complex version of it, which I’m currently using, but where it seems like OpenGL context is destroyed before GLSurfaceView finishes with its onPause() method where I’m destroying all the OpengGL shaders and textures bound to the context. Could you point me to some truly correct example of OpenGL ES 2.0 on Android using NDK concerning the correct way of pause/resume OpenGL resource handling?

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:58:19+00:00Added an answer on May 27, 2026 at 8:58 pm

    That’s not quite the right lifecycle, but it’s close. Any time a GL surface becomes completely obscured its EGL context will be destroyed, and when that happens any resources that you have allocated through OpenGL calls will be freed. As such, there is no need to manually free those resources unless your application requires active management during runtime (e.g. too many textures to cache in memory, etc).

    Note that this only applies to resources and memory allocated by OpenGL via OpenGL calls. Any buffers that you allocate outside of OpenGL do need to be freed, as usual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm considering using boost::ptr_container as a result of the responses from this question .
Considering this question of SO, where whole C# in-memory compiler is being called. When
Considering MSMQ version 3.0 Hello. I want to send and read messages from a
This question is mystifying me for years and considering this site's name, this is
This might be a dumb question, but considering the following semi-pseudo code. How do
Considering the example at the end of the question, is the map object going
Considering Simon Mourier's answer to this question: Processing Microsoft Office Outlook 2003/2007 email messages…
This is a rather simple question more or less considering syntax semantics. I've got
Disclaimer: This is a subjective question. Please follow relevant guidelines. I am considering the
This question has been bothering me for some time. The possibilities I am considering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.