After eglInitialize(), can I create window multiple times?

Hi, All,

I have an application that repeatedly creates OpenKODE window and does something
and then destories it. The window destroy sequence is:

eglMakeCurrent(m_redInfo->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(m_redInfo->egl_disp, m_redInfo->egl_ctx);
eglDestroySurface(m_redInfo->egl_disp, m_redInfo->egl_surf);
kdDestroyWindow(m_redInfo->kd_win);

However, it seems there is resourcce leak. Each loop, the process size increase.
After about 20 rounds of loop, the process hangs inside eglSwapBuffers().

If I destroy the kdWindow as this:

eglMakeCurrent(m_redInfo->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
eglDestroyContext(m_redInfo->egl_disp, m_redInfo->egl_ctx);
eglDestroySurface(m_redInfo->egl_disp, m_redInfo->egl_surf);
kdDestroyWindow(m_redInfo->kd_win);
eglTerminate(m_redInfo->egl_disp);
eglReleaseThread();

And call eglInitialize() again the second time, it still does not work.

Please inform what is the correct sequence to start kdWindow multiples with egl.

Hi,

It’s hard to be sure from this level of detail, but it sounds like this might be a bug in the OpenKODE or EGL implementation you’re using. If there is an implementation-specific developer forum for those, you might get a better response asking there and specifying the driver(s) and device you’re using.

The only general comment I can think of is that EGL resources are not always released immediately, they are (effectively) reference-counted and other parts of the system could conceivably have a reference on something that you’re attempting to destroy (mapped window that doesn’t get unmapped, say? But I’m stretching for ideas here.) Sorry not to be more helpful.

Thanks, guys, for such a detailed reply. I found much useful things there that helped me to find the solution to my issue!!!