eglInitialize fails with 12291 when re launching the X11 application

I wrote a sample Opengl-ES application running on Mali-400 GPU. 

When I run first time then it runs fine.

If I exit the application and re-launch it, then eglInitialize fails with error eglGetError(): 12291

In my code I made sure that I cleaned up all the resources.

Below is the sequence of calls my application makes. I destroyed the context, surface and display . Did un-mapping. closed the device and exited the app gracefully. 

What could be the reason for eglInitialize to fail?

eglGetDisplay

eglInitialize 

eglCreateWindowSurface

eglCreateContext

open /dev/dri/card0

mmap

eglCreateImageKHR

glEGLImageTargetTexture2DOES

eglDestroyImageKHR

munmap

close /dev/dri/card0

eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);

eglDestroyContext(display, context);

eglDestroySurface(display, surface);

eglTerminate(display);

Parents Reply Children
No data
More questions in this forum