Does finalizing `GdkGLContext` free all GPU-side OpenGL objects?

I have a global GdkGlContext which is shared by all widgets (such as GdkGLArea), I used signal create-context to make sure of this. I manually increase the reference count of this global context during application runtime. All OpenGL objects I create with glGen* are created while this context is the active context.

If the GdkGLContext instance is finalized because I called g_object_unref enough times, but the runtime of the program does not yet end, will all the OpenGL resources I manually allocated also be freed automatically? Or do I have to manually call glDelete* for each of them before the context is finalized?

I am unsure of how memory management works exactly with GdkGLContext and GPU-programming is still somewhat new to me. Thank you.

No.

Yes.

GTK does not track GL objects that you create—how could it do that? It’s up to you to release all the resources you allocated.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.